Hopefully I'm using OF_Fixed correctly

This commit is contained in:
ZZYZX 2017-01-22 08:58:59 +02:00
parent fb1d55101e
commit 2de98c2dd3

View file

@ -16,6 +16,7 @@ bool E_RegisterHandler(DStaticEventHandler* handler)
if (handler->next) if (handler->next)
handler->next->prev = handler; handler->next->prev = handler;
E_FirstEventHandler = handler; E_FirstEventHandler = handler;
if (handler->IsStatic()) handler->ObjectFlags |= OF_Fixed;
return true; return true;
} }
@ -32,6 +33,11 @@ bool E_UnregisterHandler(DStaticEventHandler* handler)
handler->next->prev = handler->prev; handler->next->prev = handler->prev;
if (handler == E_FirstEventHandler) if (handler == E_FirstEventHandler)
E_FirstEventHandler = handler->next; E_FirstEventHandler = handler->next;
if (handler->IsStatic())
{
handler->ObjectFlags |= OF_YesReallyDelete;
delete handler;
}
return true; return true;
} }