all repos — mgba @ 9dc8b9e854e52de22ee0db240e017f6bfd939f60

mGBA Game Boy Advance Emulator

Qt: Fix memory leak
Vicki Pfau vi@endrift.com
Thu, 27 Jul 2017 22:55:15 -0700
commit

9dc8b9e854e52de22ee0db240e017f6bfd939f60

parent

e9c393b8767aa0656359ffe5df43777d47ed31b2

1 files changed, 2 insertions(+), 5 deletions(-)

jump to
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -1722,11 +1722,8 @@ connect(m_controller.get(), &CoreController::started, this, &Window::gameStarted);

connect(m_controller.get(), &CoreController::started, &m_inputController, &InputController::suspendScreensaver); connect(m_controller.get(), &CoreController::stopping, this, &Window::gameStopped); { - std::shared_ptr<CoreController> controller(m_controller); - connect(m_controller.get(), &CoreController::stopping, [this, controller]() { - if (m_controller == controller) { - m_controller.reset(); - } + connect(m_controller.get(), &CoreController::stopping, [this]() { + m_controller.reset(); }); } connect(m_controller.get(), &CoreController::stopping, &m_inputController, &InputController::resumeScreensaver);