From 2b137190c8ecbfceecfc9d3f19e45ef1e5faead1 Mon Sep 17 00:00:00 2001
From: Connor McLaughlin <mclaughc@outlook.com>
Date: Sat, 26 Oct 2019 13:33:02 +1000
Subject: [PATCH] Frontend: Fix occasional power-off crash

---
 src/duckstation/sdl_interface.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/duckstation/sdl_interface.cpp b/src/duckstation/sdl_interface.cpp
index 24aff8f53..962348ef6 100644
--- a/src/duckstation/sdl_interface.cpp
+++ b/src/duckstation/sdl_interface.cpp
@@ -1163,11 +1163,12 @@ void SDLInterface::Run()
     }
 
     if (m_system)
-    {
       m_system->RunFrame();
 
-      Render();
+    Render();
 
+    if (m_system)
+    {
       // update fps counter
       const double time = m_fps_timer.GetTimeSeconds();
       if (time >= 0.25f)
@@ -1185,9 +1186,5 @@ void SDLInterface::Run()
         m_fps_timer.Reset();
       }
     }
-    else
-    {
-      Render();
-    }
   }
 }