Fix a rare crash when running simulate on macOS.
The bug was introduced in 2f0fb1e4ef. The glfwSwapBuffers call should occur on the main UI thread, not the CoreVideo DisplayLink thread.
PiperOrigin-RevId: 517172202
Change-Id: I2491f2194765019748198cd0cc61ca9263331b01
This commit is contained in:
committed by
Copybara-Service
parent
230e2780de
commit
81ba9ec54a
@@ -175,14 +175,10 @@ bool GlfwAdapter::ShouldCloseWindow() const {
|
||||
void GlfwAdapter::SwapBuffers() {
|
||||
#ifdef __APPLE__
|
||||
if (core_video_.has_value()) {
|
||||
core_video_->EnqueueSwap();
|
||||
core_video_->WaitForSwap();
|
||||
} else {
|
||||
Glfw().glfwSwapBuffers(window_);
|
||||
core_video_->WaitForDisplayRefresh();
|
||||
}
|
||||
#else
|
||||
Glfw().glfwSwapBuffers(window_);
|
||||
#endif
|
||||
Glfw().glfwSwapBuffers(window_);
|
||||
}
|
||||
|
||||
void GlfwAdapter::ToggleFullscreen() {
|
||||
|
||||
Reference in New Issue
Block a user