From 41a9e0c379c701161640b4b87d5b92ecb6f654e0 Mon Sep 17 00:00:00 2001 From: compudj Date: Thu, 12 Aug 2004 15:39:03 +0000 Subject: [PATCH] hook by id fix git-svn-id: http://ltt.polymtl.ca/svn@713 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/tracecontext.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); -- 2.34.1