mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-03 03:03:50 +01:00
Fix threading issue when exiting PPSSPP due to unjoined AdhocServer thread when AdhocServer failed to bind the socket and exited the thread early.
This commit is contained in:
1 parent
1fd54153fc
commit
6a79f59c06
4 files changed
+8
-9
No files matched your search
@@ -118,12 +118,11 @@ static int sceNetAdhocPdpRecv(int id, void* addr, void* port, void* buf, void* d
|
||||
|
||||
void __NetAdhocShutdown() {
|
||||
// Kill AdhocServer Thread
|
||||
if (adhocServerRunning) {
|
||||
adhocServerRunning = false;
|
||||
if (adhocServerThread.joinable()) {
|
||||
adhocServerThread.join();
|
||||
}
|
||||
adhocServerRunning = false;
|
||||
if (adhocServerThread.joinable()) {
|
||||
adhocServerThread.join();
|
||||
}
|
||||
|
||||
// Checks to avoid confusing logspam
|
||||
if (netAdhocMatchingInited) {
|
||||
NetAdhocMatching_Term();
|
||||
@@ -1180,8 +1179,8 @@ void __NetAdhocInit() {
|
||||
__AdhocServerInit();
|
||||
|
||||
// Create built-in AdhocServer Thread
|
||||
adhocServerRunning = false;
|
||||
if (g_Config.bEnableWlan && g_Config.bEnableAdhocServer) {
|
||||
adhocServerRunning = true;
|
||||
adhocServerThread = std::thread(proAdhocServerThread, SERVER_PORT);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user