Implement new CTF-IR reference counting scheme
[babeltrace.git] / formats / ctf / writer / writer.c
index f8a36778e39b3f1382cea2fc66bedc09f483ae1f..52c153d17a63ff96d301f276af22943242d033ff 100644 (file)
@@ -74,6 +74,8 @@ struct bt_ctf_writer *bt_ctf_writer_create(const char *path)
                goto error_destroy;
        }
 
+       bt_object_set_parent(writer->trace, writer);
+       bt_put(writer->trace);
        /* Create trace directory if necessary and open a metadata file */
        if (g_mkdir_with_parents(path, S_IRWXU | S_IRWXG)) {
                perror("g_mkdir_with_parents");
@@ -121,7 +123,7 @@ void bt_ctf_writer_destroy(struct bt_object *obj)
                }
        }
 
-       bt_put(writer->trace);
+       bt_object_release(writer->trace);
        g_free(writer);
 }
 
This page took 0.023753 seconds and 4 git commands to generate.