1
0
Fork 0
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:
elsid 2022-05-11 23:12:16 +02:00
parent 5ff4a15a01
commit a710cf6d10
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
3 changed files with 0 additions and 19 deletions

View file

@ -468,8 +468,6 @@ OMW::Engine::~Engine()
mStereoManager = nullptr;
mEnvironment.cleanup();
mMechanicsManager = nullptr;
mDialogueManager = nullptr;
mJournal = nullptr;

View file

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

View file

@ -112,8 +112,6 @@ namespace MWBase
void setFrameDuration(float value) { mFrameDuration = value; }
void cleanup();
/// Return instance of this class.
static const Environment& get()
{