mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06: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:
@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user