Skip to content

Commit

Permalink
Wait for network threads in destructor.
Browse files Browse the repository at this point in the history
Thanks to Chero.
  • Loading branch information
ratkosrb committed Nov 6, 2024
1 parent 286eb7b commit 82b57df
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/framework/Network/MangosSocketMgrImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ MangosSocketMgr<SocketType>::MangosSocketMgr():
template <typename SocketType>
MangosSocketMgr<SocketType>::~MangosSocketMgr()
{
Wait();

delete [] m_NetThreads;
delete m_Acceptor;
}
Expand Down Expand Up @@ -305,11 +307,6 @@ void MangosSocketMgr<SocketType>::StopNetwork()
for (size_t i = 0; i < m_NetThreadsCount; ++i)
m_NetThreads[i].Stop();
}

// Avoid hanging on shutdown on some unix systems.
#ifdef _WIN32
Wait();
#endif
}

template <typename SocketType>
Expand Down

0 comments on commit 82b57df

Please sign in to comment.