From 890166a732978a5f6b3461c213a65fe9d457a96a Mon Sep 17 00:00:00 2001 From: ZZYZX Date: Sun, 22 Jan 2017 08:58:59 +0200 Subject: [PATCH] Hopefully I'm using OF_Fixed correctly --- src/events.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/events.cpp b/src/events.cpp index dc563692a..29647fa6a 100755 --- a/src/events.cpp +++ b/src/events.cpp @@ -16,6 +16,7 @@ bool E_RegisterHandler(DStaticEventHandler* handler) if (handler->next) handler->next->prev = handler; E_FirstEventHandler = handler; + if (handler->IsStatic()) handler->ObjectFlags |= OF_Fixed; return true; } @@ -32,6 +33,11 @@ bool E_UnregisterHandler(DStaticEventHandler* handler) handler->next->prev = handler->prev; if (handler == E_FirstEventHandler) E_FirstEventHandler = handler->next; + if (handler->IsStatic()) + { + handler->ObjectFlags |= OF_YesReallyDelete; + delete handler; + } return true; }