.gitignore: add missing `/tests/param-validation/test_param_validation`
[babeltrace.git] / src / lib / object-pool.c
index 2542047a572a6701532a155ed3526535597e6c29..b31807434236acc32ccdb4f6733f2aa98c507592 100644 (file)
@@ -20,8 +20,8 @@
  * SOFTWARE.
  */
 
-#define BT_LOG_TAG "OBJECT-POOL"
-#include "lib/lib-logging.h"
+#define BT_LOG_TAG "LIB/OBJECT-POOL"
+#include "lib/logging.h"
 
 #include <stdint.h>
 #include "common/assert.h"
@@ -35,13 +35,14 @@ int bt_object_pool_initialize(struct bt_object_pool *pool,
 {
        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;
        }
 
@@ -53,10 +54,7 @@ int bt_object_pool_initialize(struct bt_object_pool *pool,
        goto end;
 
 error:
-       if (pool) {
-               bt_object_pool_finalize(pool);
-       }
-
+       bt_object_pool_finalize(pool);
        ret = -1;
 
 end:
This page took 0.026331 seconds and 4 git commands to generate.