Browse Source

ConfigRuntime now properly shuts down and auto-saves all configs

pull/46/head
Anairkoen Schno 5 years ago
parent
commit
a943e8de55
2 changed files with 6 additions and 0 deletions
  1. +4
    -0
      IPA.Loader/Config/ConfigRuntime.cs
  2. +2
    -0
      IPA.Loader/Loader/PluginComponent.cs

+ 4
- 0
IPA.Loader/Config/ConfigRuntime.cs View File

@ -10,6 +10,8 @@ using IPA.Utilities.Async;
using System.IO; using System.IO;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using IPA.Logging; using IPA.Logging;
using UnityEngine;
using Logger = IPA.Logging.Logger;
#if NET4 #if NET4
using Task = System.Threading.Tasks.Task; using Task = System.Threading.Tasks.Task;
using TaskEx = 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) private static void ShutdownRuntime(object sender, EventArgs e)
=> ShutdownRuntime();
internal static void ShutdownRuntime()
{ {
watcherTrackConfigs.Clear(); watcherTrackConfigs.Clear();
var watchList = watchers.ToArray(); var watchList = watchers.ToArray();


+ 2
- 0
IPA.Loader/Loader/PluginComponent.cs View File

@ -76,6 +76,8 @@ namespace IPA.Loader
bsPlugins.OnApplicationQuit(); bsPlugins.OnApplicationQuit();
ipaPlugins.OnApplicationQuit(); ipaPlugins.OnApplicationQuit();
ConfigRuntime.ShutdownRuntime(); // this seems to be needed
quitting = true; quitting = true;
} }


Loading…
Cancel
Save