diff --git a/CHANGES b/CHANGES index e537e96f6..9ede0d364 100644 --- a/CHANGES +++ b/CHANGES @@ -164,6 +164,7 @@ Bugfixes: - Qt: Fix translation initialization (fixes mgba.io/i/776) - PSP2: Use custom localtime_r since newlib version is broken (fixes mgba.io/i/560) - GBA SIO: Improve SIO Normal dummy driver (fixes mgba.io/i/520) + - Qt: Fix patch loading while a game is running Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index 8a6f63c87..b9d3d52d9 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -543,10 +543,16 @@ void GameController::replaceGame(const QString& path) { } void GameController::loadPatch(const QString& path) { - if (m_gameOpen) { + if (isLoaded()) { closeGame(); - m_patch = path; - openGame(); + } + if (m_gameOpen) { + QTimer::singleShot(10, this, [this, path]() { + loadPatch(path); + if (!m_gameOpen) { + openGame(); + } + }); } else { m_patch = path; }