From d80aaf3880a1e925de22fd9c3928afa6e5a42b40 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 29 Apr 2020 16:51:44 +1000 Subject: [PATCH] Qt: Fix possible race/crash on shutdown --- src/duckstation-qt/qthostinterface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/duckstation-qt/qthostinterface.cpp b/src/duckstation-qt/qthostinterface.cpp index c2d0e261f..ff8925830 100644 --- a/src/duckstation-qt/qthostinterface.cpp +++ b/src/duckstation-qt/qthostinterface.cpp @@ -225,8 +225,10 @@ void QtHostInterface::onDisplayWindowKeyEvent(int key, bool pressed) void QtHostInterface::onDisplayWindowMouseMoveEvent(int x, int y) { + // display might be null here if the event happened after shutdown DebugAssert(isOnWorkerThread()); - m_display->SetMousePosition(x, y); + if (m_display) + m_display->SetMousePosition(x, y); } void QtHostInterface::onDisplayWindowMouseButtonEvent(int button, bool pressed)