summaryrefslogtreecommitdiff
path: root/src/net/ea/network.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-07 06:44:38 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-07 06:44:38 +0300
commitfec0a38e6a12c8674e54a29b0c3ae54fa78e86ff (patch)
treefa68e8d59ade869c1de33bce9eb60a8cd05fdbc8 /src/net/ea/network.cpp
parentba0d8f949647aa4ced776438a1e1e9ebd77c4660 (diff)
downloadmv-fec0a38e6a12c8674e54a29b0c3ae54fa78e86ff.tar.gz
mv-fec0a38e6a12c8674e54a29b0c3ae54fa78e86ff.tar.bz2
mv-fec0a38e6a12c8674e54a29b0c3ae54fa78e86ff.tar.xz
mv-fec0a38e6a12c8674e54a29b0c3ae54fa78e86ff.zip
Fix possible thread structure memory leak on SDL2 if thread terminated before cleanup.
Diffstat (limited to 'src/net/ea/network.cpp')
-rw-r--r--src/net/ea/network.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp
index ad7909c7a..1ae4d2323 100644
--- a/src/net/ea/network.cpp
+++ b/src/net/ea/network.cpp
@@ -140,11 +140,8 @@ void Network::disconnect()
BLOCK_START("Network::disconnect")
mState = IDLE;
- if ((mWorkerThread != nullptr) && (SDL_GetThreadID(mWorkerThread) != 0u))
- {
- SDL_WaitThread(mWorkerThread, nullptr);
- mWorkerThread = nullptr;
- }
+ SDL::WaitThread(mWorkerThread);
+ mWorkerThread = nullptr;
if (mSocket != nullptr)
{