lib: update and simplify the `bt_object` API
[babeltrace.git] / lib / ctf-writer / writer.c
index b51dd7fff7244dd4329f5f2b9c68f1accd2a97c4..0b360c378a34bac90c9e0071a09ad33468e4170f 100644 (file)
@@ -120,7 +120,7 @@ struct bt_ctf_writer *bt_ctf_writer_create(const char *path)
 
        metadata_path = g_build_filename(path, "metadata", NULL);
 
-       bt_object_init(writer, bt_ctf_writer_destroy);
+       bt_object_init_shared(&writer->base, bt_ctf_writer_destroy);
        writer->path = g_string_new(path);
        if (!writer->path) {
                goto error_destroy;
@@ -148,7 +148,7 @@ struct bt_ctf_writer *bt_ctf_writer_create(const char *path)
                goto error_destroy;
        }
 
-       bt_object_set_parent(writer->trace, writer);
+       bt_object_set_parent(&writer->trace->common.base, &writer->base);
        bt_put(writer->trace);
 
        /* Default to little-endian */
@@ -195,7 +195,7 @@ void bt_ctf_writer_destroy(struct bt_object *obj)
                }
        }
 
-       bt_object_release(writer->trace);
+       bt_object_try_spec_release(&writer->trace->common.base);
        g_free(writer);
 }
 
This page took 0.023472 seconds and 4 git commands to generate.