Make OpenGL render thread shutdown more robust.

This commit is contained in:
Henrik Rydgård committed 2026-08-04 16:44:55 +02:00
1 parent 092ec2f391
commit be922eca62
20 files changed
+169 -178

No files matched your search

+6 -2
View File
@@ -42,7 +42,6 @@
#error Must be built with ARC, please revise the flags for ViewController.mm to include -fobjc-arc.
#endif
static std::atomic<bool> renderLoopRunning;
static std::thread g_emuThread;
PPSSPPBaseViewController *sharedViewController;
@@ -90,6 +89,9 @@ PPSSPPBaseViewController *sharedViewController;
- (void)requestExitGLRenderLoop {
_assert_(g_emuThread.joinable());
EmuThread_RequestExit();
// Eat up any remaining frames.
while (graphicsContext->ThreadFrame()) {}
EmuThread_Join(graphicsContext, g_emuThread);
_assert_(!g_emuThread.joinable());
}
@@ -226,7 +228,9 @@ PPSSPPBaseViewController *sharedViewController;
return;
}
if (sharedViewController) {
graphicsContext->ThreadFrame(true);
if (!graphicsContext->ThreadFrame()) {
INFO_LOG(Log::G3D, "ThreadFrame returned false");
}
}
}