Qt: Fix loading game when game is loaded
Vicki Pfau vi@endrift.com
Mon, 25 Jun 2018 10:24:10 -0700
1 files changed,
9 insertions(+),
6 deletions(-)
jump to
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -737,6 +737,7 @@ }
} void Window::gameStopped() { + m_controller.reset(); #ifdef M_CORE_GBA for (QAction* action : m_gbaActions) { action->setDisabled(false);@@ -1807,15 +1808,17 @@ void Window::setController(CoreController* controller, const QString& fname) {
if (!controller) { return; } - if (!fname.isEmpty()) { - setWindowFilePath(fname); - appendMRU(fname); - } if (m_controller) { - m_controller->disconnect(this); m_controller->stop(); - m_controller.reset(); + QTimer::singleShot(0, this, [this, controller, fname]() { + setController(controller, fname); + }); + return; + } + if (!fname.isEmpty()) { + setWindowFilePath(fname); + appendMRU(fname); } m_controller = std::shared_ptr<CoreController>(controller);