forked from Mirrors/openclonk
Clear console pointers earlier
It doesn't make a lot of sense to keep console pointers around while the objects and scripts have already been deleted. Clear them earlier so we don't have any dangling pointers.directional-lights
parent
170a793a44
commit
14bfd7ea59
|
@ -578,6 +578,13 @@ void C4Game::Clear()
|
|||
StartupScenarioParameters.Clear();
|
||||
Weather.Clear();
|
||||
GraphicsSystem.Clear();
|
||||
|
||||
#ifdef WITH_QT_EDITOR
|
||||
// clear console pointers held into script engine
|
||||
::Console.EditCursor.Clear();
|
||||
::Console.ClearGamePointers();
|
||||
#endif
|
||||
|
||||
// Clear the particles before cleaning up the objects.
|
||||
Particles.Clear();
|
||||
DeleteObjects(true);
|
||||
|
@ -607,12 +614,6 @@ void C4Game::Clear()
|
|||
::FontLoader.Clear();
|
||||
#endif
|
||||
|
||||
#ifdef WITH_QT_EDITOR
|
||||
// clear console pointers held into script engine
|
||||
::Console.EditCursor.Clear();
|
||||
::Console.ClearGamePointers();
|
||||
#endif
|
||||
|
||||
C4PropListNumbered::ClearShelve(); // may be nonempty if there was a fatal error during section load
|
||||
ScriptEngine.Clear();
|
||||
// delete any remaining prop lists from circular chains
|
||||
|
|
Loading…
Reference in New Issue