This unlikely conditin indicates a double bt_put(), or something that
went really wrong, and should be reported to the user as a warning.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
return;
}
+ if (BT_LOG_ON_WARN && unlikely(bt_object_get_ref_count(obj) == 0)) {
+ BT_LOGW("Decrementing a reference count set to 0: addr=%p",
+ ptr);
+ }
+
BT_LOGV("Decrementing object's reference count: %lu -> %lu: "
"addr=%p, cur-count=%lu, new-count=%lu",
obj->ref_count.count, obj->ref_count.count - 1,