Fix particle-related crash.

ClearAllParticles deleted the particle lists but never bothered to clear any pointers to them.
stable-5.4
Sven Eberhardt 2013-12-28 21:30:45 +01:00
parent a385102c36
commit 33d85a145e
2 changed files with 10 additions and 0 deletions

View File

@ -1163,6 +1163,14 @@ void C4ParticleList::Clear()
delete *iter;
particleChunks.clear();
if (targetObject)
{
if (this == targetObject->FrontParticles) targetObject->FrontParticles = NULL;
else if (this == targetObject->BackParticles) targetObject->BackParticles = NULL;
}
else
if(this == ::Particles.globalParticles) ::Particles.globalParticles = NULL;
accessMutex.Leave();
}

View File

@ -512,6 +512,8 @@ public:
// removes all of the existing particles (used f.e. for scenario section loading)
void ClearAllParticles();
friend class C4ParticleList;
#endif
};