timeline: call destroy callback *after* item has been removed from main queue

This commit is contained in:
Sebastian Krzyszkowiak 2012-09-26 19:49:27 +02:00
parent d6b68a3740
commit e99f1e5936

View file

@ -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);