mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-11 02:28:51 +00:00
UICommon/NetPlayIndex: Fix random segfaults after quitting NetPlay
We can't join a detached thread, so NetPlayIndex gets deleted before the notification thread exits, creating a race condition. We switch to using Common::Event because just sleeping leaves the UI hung on the thread join for a few seconds.
This commit is contained in:
parent
23986d48f7
commit
dc552f2cbb
2 changed files with 6 additions and 13 deletions
|
@ -11,7 +11,7 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/Flag.h"
|
||||
#include "Common/Event.h"
|
||||
|
||||
struct NetPlaySession
|
||||
{
|
||||
|
@ -54,8 +54,6 @@ public:
|
|||
private:
|
||||
void NotificationLoop();
|
||||
|
||||
Common::Flag m_running;
|
||||
|
||||
std::string m_secret;
|
||||
std::string m_game;
|
||||
int m_player_count = 0;
|
||||
|
@ -63,4 +61,6 @@ private:
|
|||
|
||||
std::string m_last_error;
|
||||
std::thread m_session_thread;
|
||||
|
||||
Common::Event m_session_thread_exit_event;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue