summaryrefslogtreecommitdiff
path: root/src/particle/particle.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-16 21:46:16 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-16 21:46:16 +0300
commitfd1be78642317f2a99bf2e8fdb7d3966184fb910 (patch)
tree0e83eeac67f9f9d10b9ad14b649cbc07aa315fbc /src/particle/particle.cpp
parent7c6cb759593ec5abc8cf2a3b04a388c7cba269b8 (diff)
downloadmanaverse-fd1be78642317f2a99bf2e8fdb7d3966184fb910.tar.gz
manaverse-fd1be78642317f2a99bf2e8fdb7d3966184fb910.tar.bz2
manaverse-fd1be78642317f2a99bf2e8fdb7d3966184fb910.tar.xz
manaverse-fd1be78642317f2a99bf2e8fdb7d3966184fb910.zip
Remove destructors from some particle classes.
Diffstat (limited to 'src/particle/particle.cpp')
-rw-r--r--src/particle/particle.cpp20
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;
}