From 55dd38fb2c9a272d77f1e4d47a8607f957e48c90 Mon Sep 17 00:00:00 2001 From: PopSlime Date: Tue, 19 Dec 2023 16:06:58 +0800 Subject: [PATCH] Prevents multiple initialization of extension manager. --- Assets/Cryville/Crtr/Browsing/ExtensionManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/Cryville/Crtr/Browsing/ExtensionManager.cs b/Assets/Cryville/Crtr/Browsing/ExtensionManager.cs index 45fc2a4..db8b284 100644 --- a/Assets/Cryville/Crtr/Browsing/ExtensionManager.cs +++ b/Assets/Cryville/Crtr/Browsing/ExtensionManager.cs @@ -8,6 +8,7 @@ using System.Reflection; namespace Cryville.Crtr.Browsing { internal static class ExtensionManager { + static bool _init; static readonly Dictionary> _converters = new Dictionary>(); public static ISet GetSupportedFormats() { @@ -25,6 +26,8 @@ namespace Cryville.Crtr.Browsing { return _localRes; } public static void Init(string rootPath) { + if (_init) return; + _init = true; LoadExtension(typeof(Extensions.Extension)); var asms = AppDomain.CurrentDomain.GetAssemblies().Select(a => a.GetName().Name).ToHashSet(); var modules = new Queue();