all repos — mgba @ 1fdf413ee9f31e797618d0968f709d8db0674b6b

mGBA Game Boy Advance Emulator

Qt: Fix sending gameStopped twice
Jeffrey Pfau jeffrey@endrift.com
Tue, 09 Feb 2016 02:00:45 -0800
commit

1fdf413ee9f31e797618d0968f709d8db0674b6b

parent

564f58c7fb2fc7c6bee5aed3fe1fcf7a13a3a43c

2 files changed, 6 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -1,6 +1,7 @@

0.5.0: (Future) Bugfixes: - VFS: Fix reading 7z archives without rewinding first + - Qt: Fix sending gameStopped twice Misc: - GBA: Slightly optimize GBAProcessEvents
M src/platform/qt/GameController.cppsrc/platform/qt/GameController.cpp

@@ -11,6 +11,7 @@ #include "LogController.h"

#include "MultiplayerController.h" #include "VFileDevice.h" +#include <QCoreApplication> #include <QDateTime> #include <QThread>

@@ -419,6 +420,8 @@ void GameController::closeGame() {

if (!m_gameOpen) { return; } + m_gameOpen = false; + m_rewindTimer.stop(); if (GBAThreadIsPaused(&m_threadContext)) { GBAThreadUnpause(&m_threadContext);

@@ -426,6 +429,8 @@ }

m_audioProcessor->pause(); GBAThreadEnd(&m_threadContext); GBAThreadJoin(&m_threadContext); + // Make sure the event queue clears out before the thread is reused + QCoreApplication::processEvents(); if (m_threadContext.fname) { free(const_cast<char*>(m_threadContext.fname)); m_threadContext.fname = nullptr;