From 9a19aaed5933859fb8b0ed8910a93ab96e117f51 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 27 Oct 2015 20:27:02 -0700 Subject: [PATCH] =?UTF-8?q?=C2=96Qt:=20Fix=20a=20race=20condition=20in=20P?= =?UTF-8?q?ainterGL=20that=20could=20lead=20to=20a=20crash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES | 1 + src/platform/qt/DisplayGL.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2eaaf13a4..5f6650c16 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,7 @@ Bugfixes: - Qt: Use safer isLoaded check in GameController - GBA Memory: Fix DMAs from BIOS while not in BIOS - GBA: Fix idle skip state being retained between games + - Qt: Fix a race condition in PainterGL that could lead to a crash Misc: - Qt: Window size command line options are now supported - Qt: Increase usability of key mapper diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index 62fb91ede..59c3ad49c 100644 --- a/src/platform/qt/DisplayGL.cpp +++ b/src/platform/qt/DisplayGL.cpp @@ -205,7 +205,7 @@ void PainterGL::start() { } void PainterGL::draw() { - if (m_queue.isEmpty()) { + if (m_queue.isEmpty() || !GBAThreadIsActive(m_context)) { return; } if (GBASyncWaitFrameStart(&m_context->sync) || !m_queue.isEmpty()) {