From 426364b961603a031720910598c203289bc01722 Mon Sep 17 00:00:00 2001 From: aap Date: Tue, 29 Dec 2020 20:31:06 +0100 Subject: fix custom pipes mem leak --- src/core/Game.cpp | 14 ++++++++++++++ src/core/main.cpp | 16 +--------------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/core') diff --git a/src/core/Game.cpp b/src/core/Game.cpp index b6ef7635..348ac26d 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -262,11 +262,25 @@ CGame::InitialiseRenderWare(void) CPlayerSkin::Initialise(); POP_MEMID(); +#ifdef EXTENDED_PIPELINES + CustomPipes::CustomPipeInit(); // need Scene.world for this +#endif +#ifdef SCREEN_DROPLETS + ScreenDroplets::InitDraw(); +#endif + return (true); } void CGame::ShutdownRenderWare(void) { +#ifdef SCREEN_DROPLETS + ScreenDroplets::Shutdown(); +#endif +#ifdef EXTENDED_PIPELINES + CustomPipes::CustomPipeShutdown(); +#endif + DestroySplashScreen(); CHud::Shutdown(); CFont::Shutdown(); diff --git a/src/core/main.cpp b/src/core/main.cpp index 64ef41bc..85e04540 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -481,15 +481,7 @@ Initialise3D(void *param) DebugMenuInit(); DebugMenuPopulate(); #endif // !DEBUGMENU - bool ret = CGame::InitialiseRenderWare(); -#ifdef EXTENDED_PIPELINES - CustomPipes::CustomPipeInit(); // need Scene.world for this -#endif -#ifdef SCREEN_DROPLETS - ScreenDroplets::InitDraw(); -#endif - - return ret; + return CGame::InitialiseRenderWare(); } POP_MEMID(); @@ -499,12 +491,6 @@ Initialise3D(void *param) static void Terminate3D(void) { -#ifdef SCREEN_DROPLETS - ScreenDroplets::Shutdown(); -#endif -#ifdef EXTENDED_PIPELINES - CustomPipes::CustomPipeShutdown(); -#endif CGame::ShutdownRenderWare(); #ifdef DEBUGMENU DebugMenuShutdown(); -- cgit v1.2.3