1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-20 04:09:16 +00:00

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?
This commit is contained in:
2020-04-15 10:39:21 -06:00
committed by rarified
parent b187b8fc59
commit ab400f11a7

View File

@ -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;
} }
} }