From 6a3856674cef07f2dfdc8adfac0cdd7f4245211b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 11 Mar 2021 23:13:57 +0100 Subject: [PATCH] SDL: Fix use after free on shutdown --- SDL/SDLMain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 625e470735..bfc6de059d 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -457,9 +457,9 @@ static void EmuThreadFunc(GraphicsContext *graphicsContext) { UpdateRunLoop(); } emuThreadState = (int)EmuThreadState::STOPPED; + graphicsContext->StopThread(); NativeShutdownGraphics(); - graphicsContext->StopThread(); } static void EmuThreadStart(GraphicsContext *context) {