summaryrefslogtreecommitdiffstats
path: root/source/cSocketThreads.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-19 10:36:34 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-19 10:36:34 +0100
commitf72d1e1821b116a033b8c12bd0a55b5adb6cc674 (patch)
tree6ff3012502789334728740210c81603c38a0cfd8 /source/cSocketThreads.cpp
parentGot rid of cPlayer::sPlayerState (diff)
downloadcuberite-f72d1e1821b116a033b8c12bd0a55b5adb6cc674.tar
cuberite-f72d1e1821b116a033b8c12bd0a55b5adb6cc674.tar.gz
cuberite-f72d1e1821b116a033b8c12bd0a55b5adb6cc674.tar.bz2
cuberite-f72d1e1821b116a033b8c12bd0a55b5adb6cc674.tar.lz
cuberite-f72d1e1821b116a033b8c12bd0a55b5adb6cc674.tar.xz
cuberite-f72d1e1821b116a033b8c12bd0a55b5adb6cc674.tar.zst
cuberite-f72d1e1821b116a033b8c12bd0a55b5adb6cc674.zip
Diffstat (limited to '')
-rw-r--r--source/cSocketThreads.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/cSocketThreads.cpp b/source/cSocketThreads.cpp
index 1aa802a23..fbef2a2c3 100644
--- a/source/cSocketThreads.cpp
+++ b/source/cSocketThreads.cpp
@@ -226,6 +226,15 @@ cSocketThreads::cSocketThread::cSocketThread(cSocketThreads * a_Parent) :
cSocketThreads::cSocketThread::~cSocketThread()
{
m_ShouldTerminate = true;
+
+ // Notify the thread:
+ ASSERT(m_ControlSocket2.IsValid());
+ m_ControlSocket2.Send("a", 1);
+
+ // Wait for the thread to finish:
+ Wait();
+
+ // Close the control sockets:
m_ControlSocket1.CloseSocket();
m_ControlSocket2.CloseSocket();
}