static void
attribute_finalize (LttvAttribute *self)
{
- g_hash_table_destroy(self->names);
+ guint i;
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "attribute_finalize()");
+
+ for(i=0;i<self->attributes->len;i++) {
+ lttv_attribute_remove(self, i);
+ }
+
+ g_hash_table_destroy(self->names);
g_array_free(self->attributes, TRUE);
- G_OBJECT_CLASS(g_type_class_peek_parent(
- g_type_class_peek(LTTV_ATTRIBUTE_TYPE)))->finalize(G_OBJECT(self));
}
if(last_ret == TRUE ||
count >= nb_events ||
- (end_position!=NULL)?FALSE:lttv_traceset_context_ctx_pos_compare(self,
- end_position) >= 0 ||
+ ((end_position==NULL)?FALSE:(lttv_traceset_context_ctx_pos_compare(self,
+ end_position) >= 0))||
ltt_time_compare(tfc->timestamp, end) >= 0)
{
return count;
pos->t_pos[iter_trace].tf_pos = g_new(LttEventPosition*, nb_tracefile);
for(iter_tracefile = 0; iter_tracefile < nb_tracefile; iter_tracefile++) {
- pos->t_pos[iter_trace].tf_pos[iter_tracefile]
- = ltt_event_position_new();
tfc = tc->tracefiles[iter_tracefile];
event = tfc->e;
- ltt_event_position(event,
- pos->t_pos[iter_trace].tf_pos[iter_tracefile]);
+ if(event!=NULL) {
+ pos->t_pos[iter_trace].tf_pos[iter_tracefile]
+ = ltt_event_position_new();
+ ltt_event_position(event,
+ pos->t_pos[iter_trace].tf_pos[iter_tracefile]);
+ } else {
+ pos->t_pos[iter_trace].tf_pos[iter_tracefile] = NULL;
+ }
if(ltt_time_compare(tfc->timestamp, timestamp) < 0)
timestamp = tfc->timestamp;
}
for(iter_tracefile = 0; iter_tracefile <
pos->t_pos[iter_trace].nb_tracefile;
iter_tracefile++) {
-
- g_free(pos->t_pos[iter_trace].tf_pos[iter_tracefile]);
+ if(pos->t_pos[iter_trace].tf_pos[iter_tracefile] != NULL)
+ g_free(pos->t_pos[iter_trace].tf_pos[iter_tracefile]);
}
g_free(pos->t_pos[iter_trace].tf_pos);
}
for(iter_tracefile = 0; iter_tracefile < nb_tracefile; iter_tracefile++) {
dest->t_pos[iter_trace].tf_pos[iter_tracefile] =
ltt_event_position_new();
- ltt_event_position_copy(
+ if(src->t_pos[iter_trace].tf_pos[iter_tracefile] != NULL)
+ ltt_event_position_copy(
dest->t_pos[iter_trace].tf_pos[iter_tracefile],
src->t_pos[iter_trace].tf_pos[iter_tracefile]);
+ else
+ dest->t_pos[iter_trace].tf_pos[iter_tracefile] = NULL;
}
}