summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-07 21:35:04 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-07 21:38:22 +0300
commit9ca7ca7619ae242fc1907aaea8d631d601ea1091 (patch)
tree146f953389b991e10d9a2bb55b06c600567ba358 /src/being.cpp
parenta9732d3ad6115ad7d590e819631dfbd764d13d3e (diff)
downloadmanaplus-9ca7ca7619ae242fc1907aaea8d631d601ea1091.tar.gz
manaplus-9ca7ca7619ae242fc1907aaea8d631d601ea1091.tar.bz2
manaplus-9ca7ca7619ae242fc1907aaea8d631d601ea1091.tar.xz
manaplus-9ca7ca7619ae242fc1907aaea8d631d601ea1091.zip
Fix emote leak from commit 4ad3a8e89e64ce3ae845d2786dd433ab2682393e
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 4243c5a6f..9092b0750 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -297,6 +297,8 @@ Being::~Being()
delete mText;
mText = nullptr;
+ delete mEmotionSprite;
+ mEmotionSprite = nullptr;
delete mAnimationEffect;
mAnimationEffect = nullptr;
}
@@ -2744,7 +2746,10 @@ void Being::setEmote(const uint8_t emotion, const int emote_time)
{
const int emotionIndex = emotion - 1;
if (emotionIndex >= 0 && emotionIndex <= EmoteDB::getLast())
+ {
+ delete mEmotionSprite;
mEmotionSprite = EmoteDB::getClone(emotionIndex, true);
+ }
if (mEmotionSprite)
{