From 7fbb0c4d41ee499126d730b30de185786de6ee9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 3 Jan 2023 11:02:26 +0100 Subject: [PATCH] Another null check in NativeShutdown --- UI/NativeApp.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 70230f7e0b..a2215befdc 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -1498,16 +1498,19 @@ bool NativeIsRestarting() { } void NativeShutdown() { - if (screenManager) + if (screenManager) { screenManager->shutdown(); - delete screenManager; - screenManager = nullptr; + delete screenManager; + screenManager = nullptr; + } - host->ShutdownGraphics(); + if (host) { + host->ShutdownGraphics(); + delete host; + host = nullptr; + } #if !PPSSPP_PLATFORM(UWP) - delete host; - host = nullptr; #endif g_Config.Save("NativeShutdown");