mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
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:
@ -358,7 +358,6 @@ void plSimulationMgr::Init()
|
||||
if (gTheInstance->InitSimulation())
|
||||
{
|
||||
gTheInstance->RegisterAs(kSimulationMgr_KEY);
|
||||
gTheInstance->GetKey()->RefObject();
|
||||
plgDispatch::Dispatch()->RegisterForExactType(plAgeLoadedMsg::Index(), gTheInstance->GetKey());
|
||||
}
|
||||
else
|
||||
@ -376,11 +375,8 @@ 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();
|
||||
plgDispatch::Dispatch()->UnRegisterForExactType(plAgeLoadedMsg::Index(), gTheInstance->GetKey());
|
||||
gTheInstance->UnRegister(); // this will destroy the instance
|
||||
gTheInstance->UnRegisterAs(kSimulationMgr_KEY); // this will destroy the instance
|
||||
gTheInstance = nil;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user