From 7268a70902b04e098b6b530986d9ce6d210fdd07 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 26 Feb 2012 12:55:42 +0000 Subject: Attempt at fixing crashes with disconnecting players git-svn-id: http://mc-server.googlecode.com/svn/trunk@329 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPlayer.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'source/cPlayer.cpp') diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp index 495cc6abf..7899fdc97 100644 --- a/source/cPlayer.cpp +++ b/source/cPlayer.cpp @@ -125,18 +125,14 @@ void cPlayer::Initialize( cWorld* a_World ) cPlayer::~cPlayer(void) { SaveToDisk(); - m_ClientHandle = 0; + m_ClientHandle = NULL; CloseWindow(-1); - if( m_Inventory ) - { - delete m_Inventory; - m_Inventory = 0; - } - if(m_CreativeInventory) - { - delete m_CreativeInventory; - } + delete m_Inventory; + m_Inventory = NULL; + + delete m_CreativeInventory; + delete m_pState; m_World->RemovePlayer( this ); } -- cgit v1.2.3