From: compudj Date: Thu, 12 Aug 2004 15:39:03 +0000 (+0000) Subject: hook by id fix X-Git-Tag: v0.12.20~2776 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=41a9e0c379c701161640b4b87d5b92ecb6f654e0;p=lttv.git hook by id fix git-svn-id: http://ltt.polymtl.ca/svn@713 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index e0ddd006..2150ae37 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -359,9 +359,8 @@ void lttv_tracefile_context_add_hooks(LttvTracefileContext *self, lttv_hooks_add_list(self->event, event); if(event_by_id != NULL) for(i = 0; i < lttv_hooks_by_id_max_id(event_by_id); i++) { - hook = lttv_hooks_by_id_get(self->event_by_id, i); - if(hook != NULL) - lttv_hooks_remove_list(hook, lttv_hooks_by_id_get(event_by_id, i)); + hook = lttv_hooks_by_id_find(self->event_by_id, i); + lttv_hooks_add_list(hook, lttv_hooks_by_id_get(event_by_id, i)); } } @@ -379,8 +378,9 @@ void lttv_tracefile_context_remove_hooks(LttvTracefileContext *self, lttv_hooks_remove_list(self->event, event); if(event_by_id != NULL) for(i = 0; i < lttv_hooks_by_id_max_id(event_by_id); i++) { - hook = lttv_hooks_by_id_find(self->event_by_id, i); - lttv_hooks_add_list(hook, lttv_hooks_by_id_get(event_by_id, i)); + hook = lttv_hooks_by_id_get(self->event_by_id, i); + if(hook != NULL) + lttv_hooks_remove_list(hook, lttv_hooks_by_id_get(event_by_id, i)); } lttv_hooks_call(after_tracefile, self);