summaryrefslogtreecommitdiffstats
path: root/src/OSSupport
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/OSSupport/NetworkSingleton.cpp7
-rw-r--r--src/OSSupport/NetworkSingleton.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/src/OSSupport/NetworkSingleton.cpp b/src/OSSupport/NetworkSingleton.cpp
index d0abafcbd..dcf17bccb 100644
--- a/src/OSSupport/NetworkSingleton.cpp
+++ b/src/OSSupport/NetworkSingleton.cpp
@@ -91,10 +91,8 @@ void cNetworkSingleton::Initialise(void)
// Create the event loop thread:
m_HasTerminated = false;
- m_StartupEvent.reset(new cEvent);
m_EventLoopThread = std::thread(RunEventLoop, this);
- m_StartupEvent->Wait(); // Wait for the LibEvent loop to actually start running (otherwise calling Terminate too soon would hang, see #3228)
- m_StartupEvent.reset(); // Don't need the cEvent any more, release all its resources
+ m_StartupEvent.Wait(); // Wait for the LibEvent loop to actually start running (otherwise calling Terminate too soon would hang, see #3228)
}
@@ -169,8 +167,7 @@ void cNetworkSingleton::SignalizeStartup(evutil_socket_t a_Socket, short a_Event
{
auto self = reinterpret_cast<cNetworkSingleton *>(a_Self);
ASSERT(self != nullptr);
- ASSERT(self->m_StartupEvent != nullptr);
- self->m_StartupEvent->Set();
+ self->m_StartupEvent.Set();
}
diff --git a/src/OSSupport/NetworkSingleton.h b/src/OSSupport/NetworkSingleton.h
index 75713d261..3c8f5f660 100644
--- a/src/OSSupport/NetworkSingleton.h
+++ b/src/OSSupport/NetworkSingleton.h
@@ -129,7 +129,7 @@ protected:
std::thread m_EventLoopThread;
/** Event that is signalled once the startup is finished and the LibEvent loop is running. */
- UniquePtr<cEvent> m_StartupEvent;
+ cEvent m_StartupEvent;
/** Converts LibEvent-generated log events into log messages in MCS log. */