From ab400f11a795b66754a3c63053465cb7a115096f Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 15 Apr 2020 10:39:21 -0600 Subject: [PATCH] Fix memory leak (cherry picked from commit 8cbde377efa7e8b4a2159dba28fe107bcb6dbfe0) Author: Adam Johnson Date: Mon Feb 6 21:17:08 2012 -0500 Fix an obvious memory leak. This thing was pissing me off, which made me piss off a lot of other people, which pissed off even more people, so the entire planet got pissed off and nuclear warfare began. So, let's not do stupid crap and piss me off, okay? --- .../Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp index 7690ab30..84665a05 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp @@ -319,7 +319,6 @@ void plSimulationMgr::Init() if (gTheInstance->InitSimulation()) { gTheInstance->RegisterAs(kSimulationMgr_KEY); - gTheInstance->GetKey()->RefObject(); } else { @@ -336,10 +335,7 @@ void plSimulationMgr::Shutdown() hsAssert(gTheInstance, "Simulation manager missing during shutdown."); if (gTheInstance) { - // UnRef to match our Ref in Init(). Unless something strange is - // going on, this should destroy the instance and set gTheInstance to nil. -// gTheInstance->GetKey()->UnRefObject(); - gTheInstance->UnRegister(); // this will destroy the instance + gTheInstance->UnRegisterAs(kSimulationMgr_KEY); // this will destroy the instance gTheInstance = nil; } }