forked from Mirrors/openclonk
Fix particle-related crash.
ClearAllParticles deleted the particle lists but never bothered to clear any pointers to them.stable-5.4
parent
a385102c36
commit
33d85a145e
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -512,6 +512,8 @@ public:
|
|||
// removes all of the existing particles (used f.e. for scenario section loading)
|
||||
void ClearAllParticles();
|
||||
|
||||
friend class C4ParticleList;
|
||||
|
||||
#endif
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue