From f5164f3804cea10cc9b64cb97da3b97316bff4d6 Mon Sep 17 00:00:00 2001 From: Fire-Head Date: Sun, 17 Jan 2021 03:13:21 +0300 Subject: fix crash on exit --- src/modelinfo/VehicleModelInfo.cpp | 4 ++++ src/render/Particle.cpp | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp index c8a19df1..4caacc7f 100644 --- a/src/modelinfo/VehicleModelInfo.cpp +++ b/src/modelinfo/VehicleModelInfo.cpp @@ -1108,6 +1108,7 @@ CVehicleModelInfo::SetEnvironmentMapCB(RpAtomic *atomic, void *data) void CVehicleModelInfo::SetEnvironmentMap(void) { +/* CSimpleModelInfo *wheelmi; int32 i; @@ -1125,6 +1126,7 @@ CVehicleModelInfo::SetEnvironmentMap(void) for(i = 0; i < wheelmi->m_numAtomics; i++) SetEnvironmentMapCB(wheelmi->m_atomics[i], nil); } +*/ #ifdef EXTENDED_PIPELINES CustomPipes::AttachVehiclePipe(m_clump); @@ -1150,10 +1152,12 @@ CVehicleModelInfo::LoadEnvironmentMaps(void) void CVehicleModelInfo::ShutdownEnvironmentMaps(void) { +/* RwTextureDestroy(gpWhiteTexture); gpWhiteTexture = nil; RwFrameDestroy(pMatFxIdentityFrame); pMatFxIdentityFrame = nil; +*/ } int diff --git a/src/render/Particle.cpp b/src/render/Particle.cpp index ff74bc67..a27a261a 100644 --- a/src/render/Particle.cpp +++ b/src/render/Particle.cpp @@ -904,9 +904,14 @@ void CParticle::Shutdown() { RwTextureDestroy(gpRainDripTex[i]); gpRainDripTex[i] = nil; - - RwTextureDestroy(gpRainDripDarkTex[i]); // hmm, i think gpRainDripDarkTex[1(one)] can crash, let's wait for report hehe - gpRainDripDarkTex[i] = nil; + +#ifdef FIX_BUGS + if (gpRainDripDarkTex[i]) +#endif + { + RwTextureDestroy(gpRainDripDarkTex[i]); + gpRainDripDarkTex[i] = nil; + } } RwTextureDestroy(gpBoatWakeTex); -- cgit v1.2.3