Qt: Fix memory leak
Vicki Pfau vi@endrift.com
Thu, 27 Jul 2017 22:55:15 -0700
1 files changed,
2 insertions(+),
5 deletions(-)
jump to
M
src/platform/qt/Window.cpp
→
src/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);