ir: only perform trace freeze if not already frozen
[babeltrace.git] / formats / ctf / ir / trace.c
index 0943e8f97c123aed0c1315ce5a9d579415d6ca16..3fa90aa94782af0cb8a87e980df4f7629a946218 100644 (file)
@@ -463,7 +463,8 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
                        }
                }
 
-               if (bt_ctf_stream_class_set_id_no_check(stream_class, stream_id)) {
+               if (bt_ctf_stream_class_set_id_no_check(stream_class,
+                       stream_id)) {
                        /* TODO Should retry with a different stream id */
                        ret = -1;
                        goto end;
@@ -496,7 +497,9 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
        }
 
        bt_ctf_stream_class_freeze(stream_class);
-       bt_ctf_trace_freeze(trace);
+       if (!trace->frozen) {
+               bt_ctf_trace_freeze(trace);
+       }
 end:
        if (ret) {
                (void) bt_ctf_stream_class_set_trace(stream_class, NULL);
This page took 0.024901 seconds and 4 git commands to generate.