From e99f1e5936362e03eb8f8136b8001c8214116c9a Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Wed, 26 Sep 2012 19:49:27 +0200 Subject: [PATCH] timeline: call destroy callback *after* item has been removed from main queue --- src/timeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timeline.c b/src/timeline.c index 79772a0..c85a66a 100644 --- a/src/timeline.c +++ b/src/timeline.c @@ -49,9 +49,9 @@ void TM_Process() { if ((*queue->function)(game, queue, TM_ACTIONSTATE_RUNNING)) { PrintConsole(game, "Timeline Manager: queue: destroy action (%d - %s)", queue->id, queue->name); queue->active=false; - (*queue->function)(game, queue, TM_ACTIONSTATE_DESTROY); struct TM_Action *tmp = queue; queue = queue->next; + (*tmp->function)(game, tmp, TM_ACTIONSTATE_DESTROY); free(tmp->name); free(tmp); if (queue) PrintConsole(game, "Timeline Manager: queue: run action (%d - %s)", queue->id, queue->name);