From a27734eb886d07a6b69fa26f4a027e65ec260091 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Thu, 18 Apr 2019 21:43:02 +0200 Subject: [PATCH] Fix crash related to glow and chams Needs more testing --- src/hooks/LevelShutdown.cpp | 2 ++ src/hooks/Shutdown.cpp | 2 -- src/visual/EffectGlow.cpp | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/hooks/LevelShutdown.cpp b/src/hooks/LevelShutdown.cpp index 54117a77..871f9f4f 100644 --- a/src/hooks/LevelShutdown.cpp +++ b/src/hooks/LevelShutdown.cpp @@ -16,6 +16,8 @@ DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_) playerlist::Save(); g_Settings.bInvalid = true; chat_stack::Reset(); + effect_glow::g_EffectGlow.Shutdown(); + effect_chams::g_EffectChams.Shutdown(); EC::run(EC::LevelShutdown); #if ENABLE_IPC if (ipc::peer) diff --git a/src/hooks/Shutdown.cpp b/src/hooks/Shutdown.cpp index d9fbcb13..ca560348 100644 --- a/src/hooks/Shutdown.cpp +++ b/src/hooks/Shutdown.cpp @@ -43,8 +43,6 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason) if (autoabandon) tfmm::disconnectAndAbandon(); hacks::shared::autojoin::onShutdown(); - effect_glow::g_EffectGlow.Shutdown(); - effect_chams::g_EffectChams.Shutdown(); if (*random_name) { static TextFile file; diff --git a/src/visual/EffectGlow.cpp b/src/visual/EffectGlow.cpp index e09e0221..aaf6aa62 100644 --- a/src/visual/EffectGlow.cpp +++ b/src/visual/EffectGlow.cpp @@ -213,11 +213,6 @@ void EffectGlow::Shutdown() mat_blit.Shutdown(); mat_blur_x.Shutdown(); mat_blur_y.Shutdown(); - SS_NeverSolid.Reset(); - SS_SolidInvisible.Reset(); - SS_Drawing.Reset(); - GetBuffer(1)->Release(); - GetBuffer(2)->Release(); init = false; logging::Info("Shutdown glow"); }