Qt: Fix patch loading while a game is running

This commit is contained in:
Vicki Pfau 2017-07-08 13:50:46 -07:00
parent ed9fa2b118
commit de4b735409
2 changed files with 10 additions and 3 deletions

View File

@ -168,6 +168,7 @@ Bugfixes:
- Qt: Fix translation initialization (fixes mgba.io/i/776) - Qt: Fix translation initialization (fixes mgba.io/i/776)
- PSP2: Use custom localtime_r since newlib version is broken (fixes mgba.io/i/560) - 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) - GBA SIO: Improve SIO Normal dummy driver (fixes mgba.io/i/520)
- Qt: Fix patch loading while a game is running
Misc: Misc:
- Qt: Add language selector - Qt: Add language selector
- GBA Timer: Improve accuracy of timers - GBA Timer: Improve accuracy of timers

View File

@ -543,10 +543,16 @@ void GameController::replaceGame(const QString& path) {
} }
void GameController::loadPatch(const QString& path) { void GameController::loadPatch(const QString& path) {
if (m_gameOpen) { if (isLoaded()) {
closeGame(); closeGame();
m_patch = path; }
if (m_gameOpen) {
QTimer::singleShot(10, this, [this, path]() {
loadPatch(path);
if (!m_gameOpen) {
openGame(); openGame();
}
});
} else { } else {
m_patch = path; m_patch = path;
} }