summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/NetworkSingleton.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-08-22 14:07:34 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-08-22 14:07:34 +0200
commitf52a769761d56f72b9886080c873eb6f4d28acb7 (patch)
treea176dfd7d4418da5896cb73e9625ebe16e2c84e7 /src/OSSupport/NetworkSingleton.cpp
parentMerge pull request #2443 from mjhanninen/fix-osx-build-due-warnings (diff)
parentFixed and improved restarting (diff)
downloadcuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar
cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar.gz
cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar.bz2
cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar.lz
cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar.xz
cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar.zst
cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.zip
Diffstat (limited to 'src/OSSupport/NetworkSingleton.cpp')
-rw-r--r--src/OSSupport/NetworkSingleton.cpp53
1 files changed, 31 insertions, 22 deletions
diff --git a/src/OSSupport/NetworkSingleton.cpp b/src/OSSupport/NetworkSingleton.cpp
index 417fab01e..c16f92c5a 100644
--- a/src/OSSupport/NetworkSingleton.cpp
+++ b/src/OSSupport/NetworkSingleton.cpp
@@ -18,8 +18,36 @@
-cNetworkSingleton::cNetworkSingleton(void):
- m_HasTerminated(false)
+cNetworkSingleton::cNetworkSingleton() :
+ m_HasTerminated(true)
+{
+}
+
+
+
+
+
+cNetworkSingleton::~cNetworkSingleton()
+{
+ // Check that Terminate has been called already:
+ ASSERT(m_HasTerminated);
+}
+
+
+
+
+
+cNetworkSingleton & cNetworkSingleton::Get(void)
+{
+ static cNetworkSingleton Instance;
+ return Instance;
+}
+
+
+
+
+
+void cNetworkSingleton::Initialise(void)
{
// Windows: initialize networking:
#ifdef _WIN32
@@ -64,26 +92,7 @@ cNetworkSingleton::cNetworkSingleton(void):
// Create the event loop thread:
m_EventLoopThread = std::thread(RunEventLoop, this);
-}
-
-
-
-
-
-cNetworkSingleton::~cNetworkSingleton()
-{
- // Check that Terminate has been called already:
- ASSERT(m_HasTerminated);
-}
-
-
-
-
-
-cNetworkSingleton & cNetworkSingleton::Get(void)
-{
- static cNetworkSingleton Instance;
- return Instance;
+ m_HasTerminated = false;
}