summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-01-30 08:40:45 +0100
committerMattes D <github@xoft.cz>2015-01-30 08:40:45 +0100
commitfd49e34e331fc716c48ea1228f24954e9b8b5304 (patch)
tree8d19b61fb5b3052b870ccc9ac956c5069d12dc74 /src/main.cpp
parentUpdated PolarSSL. (diff)
parentFixed listening ports not closed on cServerHandle::Close. (diff)
downloadcuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar.gz
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar.bz2
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar.lz
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar.xz
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.tar.zst
cuberite-fd49e34e331fc716c48ea1228f24954e9b8b5304.zip
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index d4adc1ed9..20609a2f8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -11,13 +11,17 @@
#include <dbghelp.h>
#endif // _MSC_VER
+#include "OSSupport/NetworkSingleton.h"
-bool cRoot::m_TerminateEventRaised = false; // If something has told the server to stop; checked periodically in cRoot
-static bool g_ServerTerminated = false; // Set to true when the server terminates, so our CTRL handler can then tell the OS to close the console
+/** If something has told the server to stop; checked periodically in cRoot */
+bool cRoot::m_TerminateEventRaised = false;
+
+/** Set to true when the server terminates, so our CTRL handler can then tell the OS to close the console. */
+static bool g_ServerTerminated = false;
/** If set to true, the protocols will log each player's incoming (C->S) communication to a per-connection logfile */
bool g_ShouldLogCommIn;
@@ -305,6 +309,9 @@ int main( int argc, char **argv)
g_ServerTerminated = true;
+ // Shutdown all of LibEvent:
+ cNetworkSingleton::Get().Terminate();
+
return EXIT_SUCCESS;
}