From b47a3804d2fec12c5fc66c5ab3fced041ae2af32 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 4 Jan 2019 16:12:39 +0100 Subject: [PATCH] - fixed delete calls on FDynamicLight. This isn't allocated from the system heap so it cannot be freed by it. --- src/g_shared/a_dynlight.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/g_shared/a_dynlight.cpp b/src/g_shared/a_dynlight.cpp index 09b1a233d..a4808d4ea 100644 --- a/src/g_shared/a_dynlight.cpp +++ b/src/g_shared/a_dynlight.cpp @@ -265,7 +265,8 @@ void FDynamicLight::Tick() { if (!target) { - delete this; + // How did we get here? :? + ReleaseLight(); return; } @@ -273,7 +274,7 @@ void FDynamicLight::Tick() { if (!target->state) { - delete this; + Deactivate(); return; } if (target->flags & MF_UNMORPHED)