return;
}
- BT_TRACE_PUT_REF_AND_RESET(ctf_fs_trace->trace);
-
if (ctf_fs_trace->path) {
g_string_free(ctf_fs_trace->path, TRUE);
}
}
if (ctf_fs_trace->metadata->trace_class) {
- ctf_fs_trace->trace = bt_trace_create(ctf_fs_trace->metadata->trace_class);
- if (!ctf_fs_trace->trace) {
+ bt_trace *trace = bt_trace_create(ctf_fs_trace->metadata->trace_class);
+ if (!trace) {
goto error;
}
+
+ ctf_fs_trace->trace = bt2::Trace::Shared::createWithoutRef(trace);
}
if (ctf_fs_trace->trace) {
- ret = ctf_trace_class_configure_ir_trace(ctf_fs_trace->metadata->tc, ctf_fs_trace->trace);
+ ret = ctf_trace_class_configure_ir_trace(ctf_fs_trace->metadata->tc,
+ ctf_fs_trace->trace->libObjPtr());
if (ret) {
goto error;
}
- ret = set_trace_name(ctf_fs_trace->trace, name, ctf_fs_trace->logger);
+ ret = set_trace_name(ctf_fs_trace->trace->libObjPtr(), name, ctf_fs_trace->logger);
if (ret) {
goto error;
}
if (ds_file_group->stream_id == UINT64_C(-1)) {
/* No stream ID: use 0 */
- stream = bt_stream_create_with_id(ds_file_group->sc->ir_sc, ctf_fs_trace->trace,
- ctf_fs_trace->next_stream_id);
+ stream =
+ bt_stream_create_with_id(ds_file_group->sc->ir_sc, ctf_fs_trace->trace->libObjPtr(),
+ ctf_fs_trace->next_stream_id);
ctf_fs_trace->next_stream_id++;
} else {
/* Specific stream ID */
- stream = bt_stream_create_with_id(ds_file_group->sc->ir_sc, ctf_fs_trace->trace,
- (uint64_t) ds_file_group->stream_id);
+ stream =
+ bt_stream_create_with_id(ds_file_group->sc->ir_sc, ctf_fs_trace->trace->libObjPtr(),
+ (uint64_t) ds_file_group->stream_id);
}
if (!stream) {