diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-06-17 16:38:00 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-08-20 17:15:23 +0200 |
commit | 4315a113935902bbbb82047e3f43695b4d76fff2 (patch) | |
tree | d57b5ebb021faa3f52b5cbf78d9a275d1ae7be1a /src/OSSupport/NetworkSingleton.cpp | |
parent | Merge pull request #2391 from SamJBarney/CropGrowthFix (diff) | |
download | cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar.gz cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar.bz2 cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar.lz cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar.xz cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar.zst cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/OSSupport/NetworkSingleton.cpp | 53 |
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; } |