summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/NetworkSingleton.cpp
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2015-07-23 21:18:16 +0200
committerJulian Laubstein <julianlaubstein@yahoo.de>2015-07-23 21:18:16 +0200
commit7cb981443e3709268d32fa2ea286f37708f07d82 (patch)
tree25021235eb076575f8c0d55e057e442f45646e90 /src/OSSupport/NetworkSingleton.cpp
parentMerge pull request #2375 from jammet/patch-8 (diff)
parentFixed cNetworkSingleton's HasTerminated flag. (diff)
downloadcuberite-7cb981443e3709268d32fa2ea286f37708f07d82.tar
cuberite-7cb981443e3709268d32fa2ea286f37708f07d82.tar.gz
cuberite-7cb981443e3709268d32fa2ea286f37708f07d82.tar.bz2
cuberite-7cb981443e3709268d32fa2ea286f37708f07d82.tar.lz
cuberite-7cb981443e3709268d32fa2ea286f37708f07d82.tar.xz
cuberite-7cb981443e3709268d32fa2ea286f37708f07d82.tar.zst
cuberite-7cb981443e3709268d32fa2ea286f37708f07d82.zip
Diffstat (limited to 'src/OSSupport/NetworkSingleton.cpp')
-rw-r--r--src/OSSupport/NetworkSingleton.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/OSSupport/NetworkSingleton.cpp b/src/OSSupport/NetworkSingleton.cpp
index 358e24438..417fab01e 100644
--- a/src/OSSupport/NetworkSingleton.cpp
+++ b/src/OSSupport/NetworkSingleton.cpp
@@ -93,7 +93,6 @@ cNetworkSingleton & cNetworkSingleton::Get(void)
void cNetworkSingleton::Terminate(void)
{
ASSERT(!m_HasTerminated);
- m_HasTerminated = true;
// Wait for the LibEvent event loop to terminate:
event_base_loopbreak(m_EventBase);
@@ -113,6 +112,10 @@ void cNetworkSingleton::Terminate(void)
event_base_free(m_EventBase);
libevent_global_shutdown();
+
+ // Set the HasTerminated flag:
+ // (Only set the flag after everything has been removed, to avoid the random failures in the Google-test, caused by links terminating after this flag was set)
+ m_HasTerminated = true;
}