From 4e5a612638f4d30900a81cad609404eec5be2f52 Mon Sep 17 00:00:00 2001 From: pmf Date: Fri, 30 May 2008 15:15:26 +0000 Subject: [PATCH] lttv: don't crash on empty trace git-svn-id: http://ltt.polymtl.ca/svn@2929 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/tracecontext.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index 5f08d78c..f5b78b5c 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -1038,7 +1038,8 @@ void lttv_trace_hook_remove_all(GArray **th) for(i=0; i<(*th)->len; i++) { g_ptr_array_free(g_array_index(*th, LttvTraceHook, i).fields, TRUE); } - *th = g_array_remove_range(*th, 0, (*th)->len); + if((*th)->len) + *th = g_array_remove_range(*th, 0, (*th)->len); } LttvTracesetContextPosition *lttv_traceset_context_position_new( -- 2.34.1