all repos — mgba @ a7fb4460298027da9d48aa91450e5268d913dc27

mGBA Game Boy Advance Emulator

Qt: Fix backup load state (fixes #823)
Vicki Pfau vi@endrift.com
Tue, 25 Jul 2017 11:15:08 -0700
commit

a7fb4460298027da9d48aa91450e5268d913dc27

parent

9de2189b2ef52ddb51dfde14befda9e4dff4e436

2 files changed, 4 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/CoreController.cppsrc/platform/qt/CoreController.cpp

@@ -408,7 +408,7 @@ CoreController* controller = static_cast<CoreController*>(context->userData);

if (!controller->m_backupLoadState.isOpen()) { controller->m_backupLoadState = VFileMemChunk(nullptr, 0); } - mCoreLoadStateNamed(context->core, controller->m_backupLoadState, controller->m_saveStateFlags); + mCoreSaveStateNamed(context->core, controller->m_backupLoadState, controller->m_saveStateFlags); if (mCoreLoadState(context->core, controller->m_stateSlot, controller->m_loadStateFlags)) { emit controller->frameAvailable(); emit controller->stateLoaded();
M src/platform/qt/VFileDevice.cppsrc/platform/qt/VFileDevice.cpp

@@ -20,6 +20,9 @@ }

} void VFileDevice::close() { + if (!m_vf) { + return; + } QIODevice::close(); m_vf->close(m_vf); m_vf = nullptr;