diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-06-08 22:44:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-06-08 22:44:47 +0300 |
commit | 7d1d6f4c001a80c05fd4f792cb6356ee546367ea (patch) | |
tree | 0ae54145288aa372a555eead4dc859a6526fb273 | |
parent | b43af191ae04ba9bd2d46608cddb4ad6fec9269b (diff) | |
download | manaplus-7d1d6f4c001a80c05fd4f792cb6356ee546367ea.tar.gz manaplus-7d1d6f4c001a80c05fd4f792cb6356ee546367ea.tar.bz2 manaplus-7d1d6f4c001a80c05fd4f792cb6356ee546367ea.tar.xz manaplus-7d1d6f4c001a80c05fd4f792cb6356ee546367ea.zip |
Possible final fix with imageset memory leaks and crashes.
-rw-r--r-- | src/particleemitter.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 592d9b078..844da5dad 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -210,7 +210,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, logger->log1("Error: no valid imageset"); continue; } -// mTempSets.push_back(imageset); + mTempSets.push_back(imageset); // Get animation frames for_each_xml_child_node(frameNode, propertyNode) @@ -294,7 +294,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, logger->log1("Error: no valid imageset"); continue; } -// mTempSets.push_back(imageset); + mTempSets.push_back(imageset); // Get animation frames for_each_xml_child_node(frameNode, propertyNode) @@ -427,6 +427,15 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o) mParticleChildEmitters = o.mParticleChildEmitters; mDeathEffectConditions = o.mDeathEffectConditions; mDeathEffect = o.mDeathEffect; + mTempSets = o.mTempSets; + + for (std::list<ImageSet*>::iterator + i = mTempSets.begin(); + i != mTempSets.end(); ++i) + { + if (*i) + (*i)->incRef(); + } mOutputPauseLeft = 0; @@ -436,10 +445,8 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o) return *this; } - ParticleEmitter::~ParticleEmitter() { -/* for (std::list<ImageSet*>::iterator i = mTempSets.begin(); i != mTempSets.end(); ++i) @@ -448,7 +455,6 @@ ParticleEmitter::~ParticleEmitter() (*i)->decRef(); } mTempSets.clear(); -*/ if (mParticleImage) { |