diff options
author | Maarten Vanraes <maarten.vanraes@gmail.com> | 2011-05-26 22:22:10 +0200 |
---|---|---|
committer | Maarten Vanraes <maarten.vanraes@gmail.com> | 2011-05-26 22:22:10 +0200 |
commit | 98b4c6c5b5eb7c60919108c130d534938aed853e (patch) | |
tree | e79828f1c10311314402544414a81d55f6177b9c /src | |
parent | 2115769d94e29479e404fdf08c553e755250dce1 (diff) | |
parent | aeef06d5d58dcc6f9339bf6ef5a87e06a4827b17 (diff) | |
download | plus-98b4c6c5b5eb7c60919108c130d534938aed853e.tar.gz plus-98b4c6c5b5eb7c60919108c130d534938aed853e.tar.bz2 plus-98b4c6c5b5eb7c60919108c130d534938aed853e.tar.xz plus-98b4c6c5b5eb7c60919108c130d534938aed853e.zip |
Merge branch 'master' of git://gitorious.org/manaplus/manaplus
Diffstat (limited to 'src')
-rw-r--r-- | src/debug/debug_new.cpp | 2 | ||||
-rw-r--r-- | src/gui/gui.cpp | 2 | ||||
-rw-r--r-- | src/particleemitter.cpp | 10 | ||||
-rw-r--r-- | src/particleemitter.h | 3 | ||||
-rw-r--r-- | src/resources/resourcemanager.cpp | 10 |
5 files changed, 25 insertions, 2 deletions
diff --git a/src/debug/debug_new.cpp b/src/debug/debug_new.cpp index de0154a94..3545af60a 100644 --- a/src/debug/debug_new.cpp +++ b/src/debug/debug_new.cpp @@ -112,7 +112,7 @@ * value makes the size of new_ptr_list_t 64 on 32-bit platforms. */ #ifndef _DEBUG_NEW_FILENAME_LEN -#define _DEBUG_NEW_FILENAME_LEN 44 +#define _DEBUG_NEW_FILENAME_LEN 100 #endif /** diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 9df692515..a23da8157 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -264,6 +264,8 @@ void Gui::setUseCustomCursor(bool customCursor) SDL_ShowCursor(SDL_DISABLE); // Load the mouse cursor + if (mMouseCursors) + mMouseCursors->decRef(); mMouseCursors = Theme::getImageSetFromTheme("mouse.png", 40, 40); if (!mMouseCursors) diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 33c2f1d92..5f107abb7 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -210,6 +210,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, logger->log1("Error: no valid imageset"); continue; } + mTempSets.push_back(imageset); // Get animation frames for_each_xml_child_node(frameNode, propertyNode) @@ -293,6 +294,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, logger->log1("Error: no valid imageset"); continue; } + mTempSets.push_back(imageset); // Get animation frames for_each_xml_child_node(frameNode, propertyNode) @@ -437,6 +439,14 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o) ParticleEmitter::~ParticleEmitter() { + for (std::list<ImageSet*>::iterator + i = mTempSets.begin(); + i != mTempSets.end(); ++i) + { + if (*i) + (*i)->decRef(); + } + if (mParticleImage) mParticleImage->decRef(); } diff --git a/src/particleemitter.h b/src/particleemitter.h index ed6518f0e..5a68584c6 100644 --- a/src/particleemitter.h +++ b/src/particleemitter.h @@ -32,6 +32,7 @@ #include <list> class Image; +class ImageSet; class Map; class Particle; @@ -150,5 +151,7 @@ class ParticleEmitter /** List of emitters the spawned particles are equipped with */ std::list<ParticleEmitter> mParticleChildEmitters; + + std::list<ImageSet*> mTempSets; }; #endif diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 79231a744..5552b64b1 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -138,8 +138,16 @@ ResourceManager::~ResourceManager() } #endif if (iter->second) + { cleanUp(iter->second); - ++iter; + ResourceIterator toErase = iter; + ++iter; + mResources.erase(toErase); + } + else + { + ++iter; + } } } |