From: Benjamin Poirier Date: Thu, 1 Apr 2010 14:49:39 +0000 (-0400) Subject: Fix two memory leaks X-Git-Tag: 0.12.32~23 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=336e21a5943e770da94553fa9559b891e0155da5;p=lttv.git Fix two memory leaks Found using valgrind, of course. Signed-off-by: Benjamin Poirier --- diff --git a/lttv/lttv/sync/event_analysis_chull.c b/lttv/lttv/sync/event_analysis_chull.c index 154258e0..21f28893 100644 --- a/lttv/lttv/sync/event_analysis_chull.c +++ b/lttv/lttv/sync/event_analysis_chull.c @@ -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 diff --git a/lttv/lttv/sync/event_processing_lttng_common.c b/lttv/lttv/sync/event_processing_lttng_common.c index 62044f6f..892d2028 100644 --- a/lttv/lttv/sync/event_processing_lttng_common.c +++ b/lttv/lttv/sync/event_processing_lttng_common.c @@ -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);