free resource data in saved states correctly in state.c
authorpmf <pmf@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 15 Oct 2007 18:54:24 +0000 (18:54 +0000)
committerpmf <pmf@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 15 Oct 2007 18:54:24 +0000 (18:54 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2693 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/state.c

index 38dcd2ef4795876f4c4b23c2393bf4be44a93928..0398bb9c074189c8e43c4d3fa029df045bc037d4 100644 (file)
@@ -1479,7 +1479,7 @@ static void state_restore(LttvTraceState *self, LttvAttribute *container)
 
 static void state_saved_free(LttvTraceState *self, LttvAttribute *container)
 {
-  guint i, nb_tracefile, nb_cpus;
+  guint i, nb_tracefile, nb_cpus, nb_irqs;
 
   LttvTracefileState *tfcs;
 
@@ -1515,6 +1515,22 @@ static void state_saved_free(LttvTraceState *self, LttvAttribute *container)
   running_process = *(value.v_pointer);
   g_free(running_process);
 
+  /* free cpu resource states */
+  type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_CPUS, &value);
+  g_assert(type == LTTV_POINTER);
+  lttv_state_free_cpu_states(self->cpu_states, nb_cpus);
+
+  /* free irq resource states */
+  nb_irqs = self->nb_irqs;
+  type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_IRQS, &value);
+  g_assert(type == LTTV_POINTER);
+  lttv_state_free_irq_states(self->irq_states, nb_irqs);
+
+  /* free the blkdev states */
+  type = lttv_attribute_get_by_name(container, LTTV_STATE_RESOURCE_BLKDEVS, &value);
+  g_assert(type == LTTV_POINTER);
+  lttv_state_free_blkdev_hashtable(self->bdev_states);
+
   nb_tracefile = self->parent.tracefiles->len;
 
   for(i = 0 ; i < nb_tracefile ; i++) {
This page took 0.026828 seconds and 4 git commands to generate.