src.ctf.fs: make ctf_fs_trace::metadata a unique_ptr
[babeltrace.git] / src / plugins / ctf / fs-src / fs.cpp
index 2b2f5bc4b6f29acf53a67ae6a550ac9531510a31..6c125461275b67aa40642f24838f7447dbb54a7a 100644 (file)
@@ -261,10 +261,6 @@ static void ctf_fs_trace_destroy(struct ctf_fs_trace *ctf_fs_trace)
         return;
     }
 
-    if (ctf_fs_trace->metadata) {
-        delete ctf_fs_trace->metadata;
-    }
-
     delete ctf_fs_trace;
 }
 
@@ -745,7 +741,7 @@ static ctf_fs_trace::UP ctf_fs_trace_create(const char *path, const char *name,
     ctf_fs_trace::UP ctf_fs_trace {new struct ctf_fs_trace(parentLogger)};
 
     ctf_fs_trace->path = path;
-    ctf_fs_trace->metadata = new ctf_fs_metadata;
+    ctf_fs_trace->metadata = bt2s::make_unique<ctf_fs_metadata>();
 
     ret = ctf_fs_metadata_set_trace_class(selfComp, ctf_fs_trace.get(), clkClsCfg);
     if (ret) {
This page took 0.023888 seconds and 4 git commands to generate.