diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-16 21:46:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-16 21:46:16 +0300 |
commit | fd1be78642317f2a99bf2e8fdb7d3966184fb910 (patch) | |
tree | 0e83eeac67f9f9d10b9ad14b649cbc07aa315fbc /src/particle/particle.cpp | |
parent | 7c6cb759593ec5abc8cf2a3b04a388c7cba269b8 (diff) | |
download | plus-fd1be78642317f2a99bf2e8fdb7d3966184fb910.tar.gz plus-fd1be78642317f2a99bf2e8fdb7d3966184fb910.tar.bz2 plus-fd1be78642317f2a99bf2e8fdb7d3966184fb910.tar.xz plus-fd1be78642317f2a99bf2e8fdb7d3966184fb910.zip |
Remove destructors from some particle classes.
Diffstat (limited to 'src/particle/particle.cpp')
-rw-r--r-- | src/particle/particle.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp index 22e350123..1df42724b 100644 --- a/src/particle/particle.cpp +++ b/src/particle/particle.cpp @@ -89,17 +89,19 @@ Particle::~Particle() delete2(mAnimation); if (mImage) { - const std::string &restrict name = mImage->getIdPath(); - StringIntMapIter it - = ImageParticle::imageParticleCountByName.find(name); - if (it != ImageParticle::imageParticleCountByName.end()) + if (mType == ParticleType::Image) { - int &cnt = (*it).second; - if (cnt > 0) - cnt --; + const std::string &restrict name = mImage->getIdPath(); + StringIntMapIter it + = ImageParticle::imageParticleCountByName.find(name); + if (it != ImageParticle::imageParticleCountByName.end()) + { + int &cnt = (*it).second; + if (cnt > 0) + cnt --; + } + mImage->decRef(); } - - mImage->decRef(); mImage = nullptr; } |