summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorTechjar <tecknojar@gmail.com>2019-04-10 22:39:16 -0400
committerTechjar <tecknojar@gmail.com>2019-04-10 22:39:16 -0400
commitf1e06b89da3e5e07dcf290bbd82effeb70011ac5 (patch)
treee78c286474748f37df9eeeaecee3a4f8290dfef3 /Source/Core
parent0497b2095566bd07ec9eecab97fe37bf5340a421 (diff)
UICommon/NetPlayIndex: Fix possible crash when Add is called again
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/UICommon/NetPlayIndex.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/Core/UICommon/NetPlayIndex.cpp b/Source/Core/UICommon/NetPlayIndex.cpp
index 36cb103243..9915bb311d 100644
--- a/Source/Core/UICommon/NetPlayIndex.cpp
+++ b/Source/Core/UICommon/NetPlayIndex.cpp
@@ -197,6 +197,11 @@ bool NetPlayIndex::Add(NetPlaySession session)
m_player_count = session.player_count;
m_game = session.game_id;
+ m_session_thread_exit_event.Set();
+ if (m_session_thread.joinable())
+ m_session_thread.join();
+ m_session_thread_exit_event.Reset();
+
m_session_thread = std::thread([this] { NotificationLoop(); });
return true;