From 065474d14e6a154ff1c768df40dca757ae53468f Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Fri, 3 Apr 2015 21:07:26 -0700 Subject: [PATCH] Qt: Fix crash when attempting to pause if a game is not running --- CHANGES | 1 + src/platform/qt/GameController.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 637248327..fe7b04583 100644 --- a/CHANGES +++ b/CHANGES @@ -61,6 +61,7 @@ Bugfixes: - GBA Memory: Fix cycle counting for 32-bit load/stores - ARM7: Fix cycle counting for loads - Qt: Pause game while open file dialogs are open (fixes #6 on GitHub) + - Qt: Fix crash when attempting to pause if a game is not running Misc: - GBA Audio: Change internal audio sample buffer from 32-bit to 16-bit samples - GBA Memory: Simplify memory API and use fixed bus width diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index 20d8e30a1..4f63ecd8f 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -334,7 +334,7 @@ bool GameController::isPaused() { } void GameController::setPaused(bool paused) { - if (paused == GBAThreadIsPaused(&m_threadContext)) { + if (!m_gameOpen || paused == GBAThreadIsPaused(&m_threadContext)) { return; } if (paused) {