VideoThread: Dispatch thread toggle failures safely

Run fatal reconfiguration handling through the active video execution context
so video-owned teardown and thread assertions execute on the correct thread.
pull/3799/head
Stenzek 1 week ago
parent c54f16ae57
commit 0cad5f5054
No known key found for this signature in database

@ -1128,8 +1128,9 @@ void VideoThread::SetThreadEnabled(bool enabled)
if (!Reconfigure(requested_renderer, requested_renderer.has_value(), fullscreen_state, requested_fullscreen_ui, true,
&error))
{
ERROR_LOG("Reconfigure failed: {}", error.GetDescription());
ReportFatalErrorAndShutdown(fmt::format("Reconfigure failed: {}", error.GetDescription()));
std::string message = fmt::format("Reconfigure failed: {}", error.GetDescription());
ERROR_LOG(message);
RunOnThreadAndSync([message = std::move(message)]() { ReportFatalErrorAndShutdown(message); });
}
}

@ -800,7 +800,7 @@ void MainWindow::recreate()
show();
// We need to close input sources, because e.g. DInput uses our window handle.
Host::RunOnCoreThread(&InputManager::CloseSources, true);
Host::RunOnCoreThread(&InputManager::CloseSources);
// Ensure we don't get a display widget creation sent to us.
const bool was_display_created = hasDisplayWidget();

Loading…
Cancel
Save