Merge pull request #2383 from cuberite/GoogleTestFix
Fixed cNetworkSingleton's HasTerminated flag.
This commit is contained in:
commit
7cb981443e
@ -93,7 +93,6 @@ cNetworkSingleton & cNetworkSingleton::Get(void)
|
|||||||
void cNetworkSingleton::Terminate(void)
|
void cNetworkSingleton::Terminate(void)
|
||||||
{
|
{
|
||||||
ASSERT(!m_HasTerminated);
|
ASSERT(!m_HasTerminated);
|
||||||
m_HasTerminated = true;
|
|
||||||
|
|
||||||
// Wait for the LibEvent event loop to terminate:
|
// Wait for the LibEvent event loop to terminate:
|
||||||
event_base_loopbreak(m_EventBase);
|
event_base_loopbreak(m_EventBase);
|
||||||
@ -113,6 +112,10 @@ void cNetworkSingleton::Terminate(void)
|
|||||||
event_base_free(m_EventBase);
|
event_base_free(m_EventBase);
|
||||||
|
|
||||||
libevent_global_shutdown();
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user