summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2019-04-11 21:49:58 +0200
committerGitHub <noreply@github.com>2019-04-11 21:49:58 +0200
commitf2e3f69d34317c7f4fc1fe4e94d470344dafd1f7 (patch)
tree0ac54c24faa8a58083c8781bad2e0ffeaeb6abf5 /Source/Core
parente8c9644da0903f5a2d1e3ba4e8eb8e02abf2cb5e (diff)
parentf1e06b89da3e5e07dcf290bbd82effeb70011ac5 (diff)
Merge pull request #7979 from Techjar/netplay-browser-possible-crash
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;