From 6038389d35f3921a04936af6990892808978d4d6 Mon Sep 17 00:00:00 2001
From: "Michael Ziminsky (Z)" <mgziminsky@users.noreply.github.com>
Date: Wed, 2 Jun 2021 13:09:31 -0700
Subject: [PATCH] NoGUI: Fix autosave on shutdown

---
 src/duckstation-nogui/main.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/duckstation-nogui/main.cpp b/src/duckstation-nogui/main.cpp
index e13d40b43..f8cfa78a9 100644
--- a/src/duckstation-nogui/main.cpp
+++ b/src/duckstation-nogui/main.cpp
@@ -69,6 +69,7 @@ static int Run(std::unique_ptr<NoGUIHostInterface> host_interface, std::unique_p
 
   if (boot_params)
     host_interface->BootSystem(*boot_params);
+  boot_params.reset(); // Need to free resume file handle so auto save on exit works
 
   int result;
   if (System::IsValid() || !host_interface->InBatchMode())