mirror of
https://github.com/OpenMW/openmw.git
synced 2025-07-03 14:41:36 +00:00
Remove Environment cleanup
Some managers may use the environment in the destructors. Setting them to nullptr may lead to nullptr dereference when the object is still alive and can be accessible. But after object is destructed it's UB anyway to dereference nullptr or a dangling pointer.
This commit is contained in:
parent
5ff4a15a01
commit
a710cf6d10
3 changed files with 0 additions and 19 deletions
|
@ -468,8 +468,6 @@ OMW::Engine::~Engine()
|
|||
|
||||
mStereoManager = nullptr;
|
||||
|
||||
mEnvironment.cleanup();
|
||||
|
||||
mMechanicsManager = nullptr;
|
||||
mDialogueManager = nullptr;
|
||||
mJournal = nullptr;
|
||||
|
|
|
@ -28,21 +28,6 @@ MWBase::Environment::~Environment()
|
|||
sThis = nullptr;
|
||||
}
|
||||
|
||||
void MWBase::Environment::cleanup()
|
||||
{
|
||||
mMechanicsManager = nullptr;
|
||||
mDialogueManager = nullptr;
|
||||
mJournal = nullptr;
|
||||
mScriptManager = nullptr;
|
||||
mWindowManager = nullptr;
|
||||
mWorld = nullptr;
|
||||
mSoundManager = nullptr;
|
||||
mInputManager = nullptr;
|
||||
mStateManager = nullptr;
|
||||
mLuaManager = nullptr;
|
||||
mResourceSystem = nullptr;
|
||||
}
|
||||
|
||||
void MWBase::Environment::reportStats(unsigned int frameNumber, osg::Stats& stats) const
|
||||
{
|
||||
mMechanicsManager->reportStats(frameNumber, stats);
|
||||
|
|
|
@ -112,8 +112,6 @@ namespace MWBase
|
|||
|
||||
void setFrameDuration(float value) { mFrameDuration = value; }
|
||||
|
||||
void cleanup();
|
||||
|
||||
/// Return instance of this class.
|
||||
static const Environment& get()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue