From 4f5472d561e58a84627b10edaf5d05ac314534d2 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Thu, 12 Dec 2019 19:32:51 -0600 Subject: [PATCH] ConfigRuntime now properly shuts down and auto-saves all configs --- IPA.Loader/Config/ConfigRuntime.cs | 4 ++++ IPA.Loader/Loader/PluginComponent.cs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/IPA.Loader/Config/ConfigRuntime.cs b/IPA.Loader/Config/ConfigRuntime.cs index 2bd908bb..57b7c931 100644 --- a/IPA.Loader/Config/ConfigRuntime.cs +++ b/IPA.Loader/Config/ConfigRuntime.cs @@ -10,6 +10,8 @@ using IPA.Utilities.Async; using System.IO; using System.Runtime.CompilerServices; using IPA.Logging; +using UnityEngine; +using Logger = IPA.Logging.Logger; #if NET4 using Task = System.Threading.Tasks.Task; using TaskEx = System.Threading.Tasks.Task; @@ -59,6 +61,8 @@ namespace IPA.Config } private static void ShutdownRuntime(object sender, EventArgs e) + => ShutdownRuntime(); + internal static void ShutdownRuntime() { watcherTrackConfigs.Clear(); var watchList = watchers.ToArray(); diff --git a/IPA.Loader/Loader/PluginComponent.cs b/IPA.Loader/Loader/PluginComponent.cs index 61a71001..ea66eccd 100644 --- a/IPA.Loader/Loader/PluginComponent.cs +++ b/IPA.Loader/Loader/PluginComponent.cs @@ -76,6 +76,8 @@ namespace IPA.Loader bsPlugins.OnApplicationQuit(); ipaPlugins.OnApplicationQuit(); + ConfigRuntime.ShutdownRuntime(); // this seems to be needed + quitting = true; }