Fix two memory leaks
authorBenjamin Poirier <benjamin.poirier@polymtl.ca>
Thu, 1 Apr 2010 14:49:39 +0000 (10:49 -0400)
committerBenjamin Poirier <benjamin.poirier@polymtl.ca>
Wed, 7 Apr 2010 16:11:38 +0000 (12:11 -0400)
Found using valgrind, of course.

Signed-off-by: Benjamin Poirier <benjamin.poirier@polymtl.ca>
lttv/lttv/sync/event_analysis_chull.c
lttv/lttv/sync/event_processing_lttng_common.c

index 154258e00effc5af9369dc13c1c036e2d999125a..21f288939c2fe1f9408cfb4d466dc22562e187fd 100644 (file)
@@ -384,13 +384,15 @@ static void destroyAnalysisCHull(SyncState* const syncState)
 
                        for (j= 0; j < i; j++)
                        {
-                               // There seems to be a memory leak in glpk, valgrind reports a
-                               // loss (reachable) even if the problem is deleted
                                glp_delete_prob(analysisData->lps[i][j]);
                        }
                        free(analysisData->lps[i]);
                }
                free(analysisData->lps);
+
+               /* Be careful, this invalidates all problem objects which still exist.
+                * Don't keep copies of lps past this point. */
+               glp_free_env();
        }
 #endif
 
index 62044f6f891ea680907b178a8593d560b95360dc..892d2028c388e8704e1ba042fce9d56de671f171 100644 (file)
@@ -240,6 +240,7 @@ void unregisterHooks(GArray* hookListList, LttvTracesetContext* const
                        }
                }
 
+               lttv_trace_hook_remove_all(&hookList);
                g_array_free(hookList, TRUE);
        }
        g_array_free(hookListList, TRUE);
This page took 0.025028 seconds and 4 git commands to generate.