diff options
| author | Techjar <tecknojar@gmail.com> | 2019-04-10 22:39:16 -0400 |
|---|---|---|
| committer | Techjar <tecknojar@gmail.com> | 2019-04-10 22:39:16 -0400 |
| commit | f1e06b89da3e5e07dcf290bbd82effeb70011ac5 (patch) | |
| tree | e78c286474748f37df9eeeaecee3a4f8290dfef3 /Source/Core | |
| parent | 0497b2095566bd07ec9eecab97fe37bf5340a421 (diff) | |
UICommon/NetPlayIndex: Fix possible crash when Add is called again
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/UICommon/NetPlayIndex.cpp | 5 |
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; |
