Browse Source

Fix memory leak (cherry picked from commit 8cbde377ef)

Author: Adam Johnson <AdamJohnso@gmail.com>
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?
rarified/vs2003buildtargets
Adam Johnson 5 years ago committed by rarified
parent
commit
ab400f11a7
  1. 6
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp

6
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp

@ -319,7 +319,6 @@ void plSimulationMgr::Init()
if (gTheInstance->InitSimulation()) if (gTheInstance->InitSimulation())
{ {
gTheInstance->RegisterAs(kSimulationMgr_KEY); gTheInstance->RegisterAs(kSimulationMgr_KEY);
gTheInstance->GetKey()->RefObject();
} }
else else
{ {
@ -336,10 +335,7 @@ void plSimulationMgr::Shutdown()
hsAssert(gTheInstance, "Simulation manager missing during shutdown."); hsAssert(gTheInstance, "Simulation manager missing during shutdown.");
if (gTheInstance) if (gTheInstance)
{ {
// UnRef to match our Ref in Init(). Unless something strange is gTheInstance->UnRegisterAs(kSimulationMgr_KEY); // this will destroy the instance
// going on, this should destroy the instance and set gTheInstance to nil.
// gTheInstance->GetKey()->UnRefObject();
gTheInstance->UnRegister(); // this will destroy the instance
gTheInstance = nil; gTheInstance = nil;
} }
} }

Loading…
Cancel
Save