summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/ministatus.cpp9
-rw-r--r--src/mumblemanager.cpp6
-rw-r--r--src/particleemitter.cpp16
3 files changed, 22 insertions, 9 deletions
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp
index 6809a5149..4c57812d5 100644
--- a/src/gui/ministatus.cpp
+++ b/src/gui/ministatus.cpp
@@ -43,6 +43,7 @@
#include "net/playerhandler.h"
#include "net/gamehandler.h"
+#include "utils/dtor.h"
#include "utils/gettext.h"
#include "utils/stringutils.h"
@@ -126,6 +127,8 @@ MiniStatusWindow::~MiniStatusWindow()
mTextPopup = 0;
delete mStatusPopup;
mStatusPopup = 0;
+ delete_all(mIcons);
+ mIcons.clear();
Inventory *inv = PlayerInfo::getInventory();
if (inv)
@@ -194,7 +197,11 @@ void MiniStatusWindow::setIcon(int index, AnimatedSprite *sprite)
void MiniStatusWindow::eraseIcon(int index)
{
- mIcons.erase(mIcons.begin() + index);
+ if (index < static_cast<int>(mIcons.size()))
+ {
+ delete mIcons[index];
+ mIcons.erase(mIcons.begin() + index);
+ }
}
void MiniStatusWindow::drawIcons(Graphics *graphics)
diff --git a/src/mumblemanager.cpp b/src/mumblemanager.cpp
index 921d53e4f..d3eacc64b 100644
--- a/src/mumblemanager.cpp
+++ b/src/mumblemanager.cpp
@@ -39,7 +39,7 @@ MumbleManager::~MumbleManager()
{
#ifdef WIN32
UnmapViewOfFile(mLinkedMem);
-#elif defined __FreeBSD__ || defined __DragonFly__
+#elif defined __FreeBSD__ || defined __DragonFly__ || defined __APPLE__
#else
munmap(mLinkedMem, sizeof(struct LinkedMem));
#endif
@@ -73,7 +73,7 @@ void MumbleManager::setMapBase(uint16_t mapid)
void MumbleManager::init()
{
-#if defined __FreeBSD__ || defined __DragonFly__
+#if defined __FreeBSD__ || defined __DragonFly__ || defined __APPLE__
return;
#endif
@@ -100,7 +100,7 @@ void MumbleManager::init()
logger->log1("MumbleManager::init can't map MumbleLink");
return;
}
-#elif defined __FreeBSD__ || defined __DragonFly__
+#elif defined __FreeBSD__ || defined __DragonFly__ || defined __APPLE__
#else
char memName[256];
snprintf(memName, 256, "/MumbleLink.%d", getuid());
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)
{