#include <babeltrace/ref-internal.h>
#include <babeltrace/ref.h>
+#include <babeltrace/assert-internal.h>
/**
* All objects publicly exposed by Babeltrace APIs must contain this structure
obj->ref_count.count);
#endif
- if (obj && obj->release && !bt_object_get_ref_count(obj)) {
+ if (obj && obj->release && bt_object_get_ref_count(obj) == 0) {
obj->release(obj);
}
}
void bt_object_set_parent_is_owner_listener(void *obj,
bt_object_release_func cb)
{
- assert(obj);
+ BT_ASSERT(obj);
((struct bt_object *) obj)->parent_is_owner_listener = cb;
}