1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 16:50:07 +00:00

fix custom pipes mem leak

This commit is contained in:
aap 2020-12-29 20:31:06 +01:00
parent 1867a6c47b
commit 426364b961
3 changed files with 24 additions and 15 deletions

View file

@ -262,11 +262,25 @@ CGame::InitialiseRenderWare(void)
CPlayerSkin::Initialise(); CPlayerSkin::Initialise();
POP_MEMID(); POP_MEMID();
#ifdef EXTENDED_PIPELINES
CustomPipes::CustomPipeInit(); // need Scene.world for this
#endif
#ifdef SCREEN_DROPLETS
ScreenDroplets::InitDraw();
#endif
return (true); return (true);
} }
void CGame::ShutdownRenderWare(void) void CGame::ShutdownRenderWare(void)
{ {
#ifdef SCREEN_DROPLETS
ScreenDroplets::Shutdown();
#endif
#ifdef EXTENDED_PIPELINES
CustomPipes::CustomPipeShutdown();
#endif
DestroySplashScreen(); DestroySplashScreen();
CHud::Shutdown(); CHud::Shutdown();
CFont::Shutdown(); CFont::Shutdown();

View file

@ -481,15 +481,7 @@ Initialise3D(void *param)
DebugMenuInit(); DebugMenuInit();
DebugMenuPopulate(); DebugMenuPopulate();
#endif // !DEBUGMENU #endif // !DEBUGMENU
bool ret = CGame::InitialiseRenderWare(); return CGame::InitialiseRenderWare();
#ifdef EXTENDED_PIPELINES
CustomPipes::CustomPipeInit(); // need Scene.world for this
#endif
#ifdef SCREEN_DROPLETS
ScreenDroplets::InitDraw();
#endif
return ret;
} }
POP_MEMID(); POP_MEMID();
@ -499,12 +491,6 @@ Initialise3D(void *param)
static void static void
Terminate3D(void) Terminate3D(void)
{ {
#ifdef SCREEN_DROPLETS
ScreenDroplets::Shutdown();
#endif
#ifdef EXTENDED_PIPELINES
CustomPipes::CustomPipeShutdown();
#endif
CGame::ShutdownRenderWare(); CGame::ShutdownRenderWare();
#ifdef DEBUGMENU #ifdef DEBUGMENU
DebugMenuShutdown(); DebugMenuShutdown();

View file

@ -172,6 +172,9 @@ DestroyVehiclePipe(void)
rw::d3d::destroyVertexShader(neoVehicle_VS); rw::d3d::destroyVertexShader(neoVehicle_VS);
neoVehicle_VS = nil; neoVehicle_VS = nil;
rw::d3d::destroyPixelShader(neoVehicle_PS);
neoVehicle_PS = nil;
((rw::d3d9::ObjPipeline*)vehiclePipe)->destroy(); ((rw::d3d9::ObjPipeline*)vehiclePipe)->destroy();
vehiclePipe = nil; vehiclePipe = nil;
} }
@ -363,6 +366,12 @@ CreateGlossPipe(void)
void void
DestroyGlossPipe(void) DestroyGlossPipe(void)
{ {
rw::d3d::destroyVertexShader(neoGloss_VS);
neoGloss_VS = nil;
rw::d3d::destroyPixelShader(neoGloss_PS);
neoGloss_PS = nil;
((rw::d3d9::ObjPipeline*)glossPipe)->destroy(); ((rw::d3d9::ObjPipeline*)glossPipe)->destroy();
glossPipe = nil; glossPipe = nil;
} }