Fix error on attempt to reload actions when the game is shutting down.
This commit is contained in:
@@ -37,10 +37,12 @@ namespace Cryville.Crtr.Browsing.UI {
|
|||||||
readonly HashSet<int> _selectedItems = new HashSet<int>();
|
readonly HashSet<int> _selectedItems = new HashSet<int>();
|
||||||
readonly Dictionary<int, BrowserItem> _items = new Dictionary<int, BrowserItem>();
|
readonly Dictionary<int, BrowserItem> _items = new Dictionary<int, BrowserItem>();
|
||||||
|
|
||||||
|
bool _destroyed;
|
||||||
protected virtual void Start() {
|
protected virtual void Start() {
|
||||||
m_itemContainer.LoadItem = LoadItem;
|
m_itemContainer.LoadItem = LoadItem;
|
||||||
}
|
}
|
||||||
void OnDestroy() {
|
void OnDestroy() {
|
||||||
|
_destroyed = true;
|
||||||
UnregisterManager();
|
UnregisterManager();
|
||||||
}
|
}
|
||||||
void UnregisterManager() {
|
void UnregisterManager() {
|
||||||
@@ -124,6 +126,7 @@ namespace Cryville.Crtr.Browsing.UI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
internal override void OnActionsChanged() {
|
internal override void OnActionsChanged() {
|
||||||
|
if (_destroyed) return;
|
||||||
if (_selectedItems.Count == 1) {
|
if (_selectedItems.Count == 1) {
|
||||||
LoadActions(_manager[_selectedItems.Single()]);
|
LoadActions(_manager[_selectedItems.Single()]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user