summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-10-31 14:14:26 -0400
committerChuck Miller <shadowmil@gmail.com>2010-10-31 14:34:14 -0400
commitc5e341f7b5f5e4efcabd09e00e177bb873db8097 (patch)
tree208f273adc072cbe4f8c8ae850e05bfd55c5dbba
parent1d96d9d100e528d881d57398bb8e13c6b0f7b559 (diff)
downloadmana-c5e341f7b5f5e4efcabd09e00e177bb873db8097.tar.gz
mana-c5e341f7b5f5e4efcabd09e00e177bb873db8097.tar.bz2
mana-c5e341f7b5f5e4efcabd09e00e177bb873db8097.tar.xz
mana-c5e341f7b5f5e4efcabd09e00e177bb873db8097.zip
Fix memory leak of localplayer classes in the charserverhandler
They are initialized else where in the code Reviewed-by: Jared Adams
-rw-r--r--src/net/charhandler.h2
-rw-r--r--src/net/manaserv/charhandler.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/net/charhandler.h b/src/net/charhandler.h
index c2be5714..25fc3563 100644
--- a/src/net/charhandler.h
+++ b/src/net/charhandler.h
@@ -41,7 +41,7 @@ struct Character
{
Character() :
slot(0),
- dummy(new LocalPlayer)
+ dummy(0)
{
}
diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp
index a4aaf21b..d44c62fe 100644
--- a/src/net/manaserv/charhandler.cpp
+++ b/src/net/manaserv/charhandler.cpp
@@ -361,7 +361,7 @@ void CharHandler::updateCharacters()
Net::Character *character = new Net::Character;
character->slot = info.slot;
- LocalPlayer *player = character->dummy;
+ LocalPlayer *player = character->dummy = new LocalPlayer;
player->setName(info.name);
player->setGender(info.gender);
player->setSprite(SPRITE_HAIR, info.hairStyle * -1,