fix possible crash on cleaning up particles

It could happen that the objects were cleared (after evaluation screen / on section change) but a particle list would remain that would still point to an object (and would then access it).
I am not exactly sure how that could happen, because objects should clear their particle lists on removal (and thus shouldn't really need a ClearPointers).
There is a tiny chance that this points to another bug somewhere in the object removal - that's just a random guess though.

Anyway, this should fix the infamous Knüppeln crash.
qteditor
David Dormagen 2016-05-28 23:22:33 +02:00
parent 2df2946016
commit acde7c923a
1 changed files with 2 additions and 1 deletions

View File

@ -575,12 +575,13 @@ void C4Game::Clear()
StartupScenarioParameters.Clear();
Weather.Clear();
GraphicsSystem.Clear();
// Clear the particles before cleaning up the objects.
Particles.Clear();
DeleteObjects(true);
::Definitions.Clear();
Landscape.Clear();
PXS.Clear();
ScriptGuiRoot.reset();
Particles.Clear();
::MaterialMap.Clear();
TextureMap.Clear(); // texture map *MUST* be cleared after the materials, because of the patterns!
::Messages.Clear();