From 86b8b1ce3b46cea8e92a052a05cc5f8d10b63ca8 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 5a89fc609..e9411b7e0 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ Bugfixes: - Qt: Use safer isLoaded check in GameController - GBA: Fix idle skip state being retained between games + - Qt: Fix a race condition in PainterGL that could lead to a crash Misc: - GBA Audio: Implement missing flags on SOUNDCNT_X register diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index d0a5f4db3..f9fe1356e 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_context->frameskip) || !m_queue.isEmpty()) {