From 50879a1f3f1081c9d333083d123a1d83bf095993 Mon Sep 17 00:00:00 2001 From: PopSlime Date: Tue, 19 Dec 2023 16:40:59 +0800 Subject: [PATCH] Fix error on attempt to reload actions when the game is shutting down. --- Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs b/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs index 8699755..ba766f2 100644 --- a/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs +++ b/Assets/Cryville/Crtr/Browsing/UI/PathedResourceBrowser.cs @@ -37,10 +37,12 @@ namespace Cryville.Crtr.Browsing.UI { readonly HashSet _selectedItems = new HashSet(); readonly Dictionary _items = new Dictionary(); + bool _destroyed; protected virtual void Start() { m_itemContainer.LoadItem = LoadItem; } void OnDestroy() { + _destroyed = true; UnregisterManager(); } void UnregisterManager() { @@ -124,6 +126,7 @@ namespace Cryville.Crtr.Browsing.UI { } } internal override void OnActionsChanged() { + if (_destroyed) return; if (_selectedItems.Count == 1) { LoadActions(_manager[_selectedItems.Single()]); }