all repos — mgba @ a77a68bd2a14d2604be9a895567a81b66f547d23

mGBA Game Boy Advance Emulator

Qt: Fix crash when saving an override if a game isn't loaded
Jeffrey Pfau jeffrey@endrift.com
Tue, 04 Oct 2016 13:09:02 -0700
commit

a77a68bd2a14d2604be9a895567a81b66f547d23

parent

7ee3bf2482e94ac56dc9555ee37ce071b032ea28

3 files changed, 7 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -25,6 +25,7 @@ - GB: Properly clear KEY1 bit 0 when switching speeds

- GBA Cheats: Fix uninitialized memory getting freed when saving - GBA Memory: Fix several unused I/O register read values - Qt: Fix patch loading + - Qt: Fix crash when saving an override if a game isn't loaded Misc: - All: Only update version info if needed - FFmpeg: Encoding cleanup
M src/platform/qt/GameController.cppsrc/platform/qt/GameController.cpp

@@ -574,6 +574,7 @@ if (mCoreThreadIsPaused(&m_threadContext)) {

mCoreThreadUnpause(&m_threadContext); } m_patch = QString(); + clearOverride(); QMetaObject::invokeMethod(m_audioProcessor, "pause", Qt::BlockingQueuedConnection); mCoreThreadEnd(&m_threadContext);
M src/platform/qt/OverrideView.cppsrc/platform/qt/OverrideView.cpp

@@ -5,6 +5,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this

* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "OverrideView.h" +#include <QPushButton> + #include "ConfigController.h" #include "GameController.h"

@@ -89,6 +91,7 @@ #endif

connect(m_ui.buttonBox, SIGNAL(accepted()), this, SLOT(saveOverride())); connect(m_ui.buttonBox, SIGNAL(rejected()), this, SLOT(close())); + m_ui.buttonBox->button(QDialogButtonBox::Save)->setEnabled(false); if (controller->isLoaded()) { gameStarted(controller->thread());

@@ -171,6 +174,7 @@ return;

} m_ui.tabWidget->setEnabled(false); + m_ui.buttonBox->button(QDialogButtonBox::Save)->setEnabled(true); switch (thread->core->platform(thread->core)) { #ifdef M_CORE_GBA

@@ -221,6 +225,7 @@ void OverrideView::gameStopped() {

m_ui.tabWidget->setEnabled(true); m_ui.savetype->setCurrentIndex(0); m_ui.idleLoop->clear(); + m_ui.buttonBox->button(QDialogButtonBox::Save)->setEnabled(false); m_ui.mbc->setCurrentIndex(0); m_ui.gbModel->setCurrentIndex(0);