From 130cb63bbc45819d844dd7cf30015a533d4168d8 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 26 May 2019 09:32:00 -0700 Subject: [PATCH] Qt: Fix shutdown leaks --- src/platform/qt/CoreController.cpp | 3 +++ src/platform/qt/Window.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/platform/qt/CoreController.cpp b/src/platform/qt/CoreController.cpp index d073ac654..579f75d04 100644 --- a/src/platform/qt/CoreController.cpp +++ b/src/platform/qt/CoreController.cpp @@ -197,6 +197,9 @@ CoreController::~CoreController() { mCacheSetDeinit(m_cacheSet.get()); m_cacheSet.reset(); } + + mCoreConfigDeinit(&m_threadContext.core->config); + m_threadContext.core->deinit(m_threadContext.core); } const color_t* CoreController::drawContext() { diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 24a37b0d8..7cdc73a4d 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -780,11 +780,6 @@ void Window::gameStarted() { void Window::gameStopped() { m_controller.reset(); - m_display->stopDrawing(); - if (m_pendingClose) { - m_display.reset(); - close(); - } #ifdef M_CORE_GBA for (Action* action : m_platformActions) { action->setEnabled(true); @@ -819,6 +814,11 @@ void Window::gameStopped() { m_audioProcessor->stop(); m_audioProcessor.reset(); } + m_display->stopDrawing(); + if (m_pendingClose) { + m_display.reset(); + close(); + } #ifdef USE_DISCORD_RPC DiscordCoordinator::gameStopped();