diff --git a/src/xenia/emulator.cc b/src/xenia/emulator.cc index 523b3fadd..ae64b8c9f 100644 --- a/src/xenia/emulator.cc +++ b/src/xenia/emulator.cc @@ -1445,7 +1445,15 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path, const std::string_view module_path) { // Making changes to the UI (setting the icon) and executing game config // load callbacks which expect to be called from the UI thread. - assert_true(display_window_->app_context().IsInUIThread()); + // If not on UI thread, dispatch to it synchronously. + if (!display_window_->app_context().IsInUIThread()) { + X_STATUS result = X_STATUS_UNSUCCESSFUL; + display_window_->app_context().CallInUIThreadSynchronous( + [this, &path, &module_path, &result]() { + result = CompleteLaunch(path, module_path); + }); + return result; + } // Setup NullDevices for raw HDD partition accesses // Cache/STFC code baked into games tries reading/writing to these