X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Ftraceset.c;h=fd67c68859b834ca4daeee12fb64317456579689;hb=58c88a41c3beff0c4c6ff7d856ab2355820d9f16;hp=0e91c9dcf00ee7000daf34b344d83826430afc9a;hpb=3e67c985ec32ef250e8b11dd29c13aad68fb4902;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/traceset.c b/ltt/branches/poly/lttv/lttv/traceset.c index 0e91c9dc..fd67c688 100644 --- a/ltt/branches/poly/lttv/lttv/traceset.c +++ b/ltt/branches/poly/lttv/lttv/traceset.c @@ -83,13 +83,10 @@ LttvTraceset *lttv_traceset_copy(LttvTraceset *s_orig) trace = g_ptr_array_index(s_orig->traces, i); trace->ref_count++; - /*CHECK this used ltt_trace_copy while it may not be needed. Need to - define how traces and tracesets are shared */ - g_ptr_array_add( - s->traces, - g_ptr_array_index(s_orig->traces, i)); + g_ptr_array_add(s->traces, + trace); } - s->a = LTTV_ATTRIBUTE(lttv_iattribute_deep_copy((LttvIAttribute*)s_orig->a)); + s->a = LTTV_ATTRIBUTE(lttv_iattribute_deep_copy(LTTV_IATTRIBUTE(s_orig->a))); return s; } @@ -122,6 +119,14 @@ gint lttv_traceset_save(LttvTraceset *s) void lttv_traceset_destroy(LttvTraceset *s) { + guint i; + + for(i=0;itraces->len;i++) { + LttvTrace *trace = g_ptr_array_index(s->traces, i); + lttv_trace_unref(trace); + if(lttv_trace_get_ref_number(trace) == 0) + lttv_trace_destroy(trace); + } g_ptr_array_free(s->traces, TRUE); g_object_unref(s->a); g_free(s);