all repos — mgba @ 742538dc432a3d85b66318eded435a73dfce0f5c

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

742538dc432a3d85b66318eded435a73dfce0f5c

parent

c8db38f93b391b53d4b323122720b01b371823b2

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

jump to
M CHANGESCHANGES

@@ -28,6 +28,7 @@ - LR35902: Fix core never exiting with certain event patterns

- 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);