*/
#define BT_LOG_TAG "LIB/OBJECT-POOL"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
#include <stdint.h>
#include "common/assert.h"
{
int ret = 0;
+ BT_ASSERT(pool);
BT_ASSERT(new_object_func);
BT_ASSERT(destroy_object_func);
BT_LOGD("Initializing object pool: addr=%p, data-addr=%p",
pool, data);
pool->objects = g_ptr_array_new();
if (!pool->objects) {
- BT_LOGE_STR("Failed to allocate a GPtrArray.");
+ BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GPtrArray.");
goto error;
}
goto end;
error:
- if (pool) {
- bt_object_pool_finalize(pool);
- }
-
+ bt_object_pool_finalize(pool);
ret = -1;
end: