From e2ff4a2e5c654e1c4c33f5a9098bef35e0755897 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 14 Aug 2013 19:56:29 +0200 Subject: Clients are deleted when the world is stopped. This fixes #92. --- source/World.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source') diff --git a/source/World.cpp b/source/World.cpp index 59240c7da..5c3a24177 100644 --- a/source/World.cpp +++ b/source/World.cpp @@ -552,6 +552,17 @@ void cWorld::Start(void) void cWorld::Stop(void) { + // Delete the clients that have been in this world: + { + cCSLock Lock(m_CSClients); + for (cClientHandleList::iterator itr = m_Clients.begin(); itr != m_Clients.end(); ++itr) + { + (*itr)->Destroy(); + delete *itr; + } // for itr - m_Clients[] + m_Clients.clear(); + } + m_TickThread.Stop(); m_Lighting.Stop(); m_Generator.Stop(); -- cgit v1.2.3