mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-21 23:58:49 -05:00
fix: handling dead references when resetting objects for AtomValueList. (#417)
This commit is contained in:
parent
b77403cd72
commit
6e51c70f33
@ -74,6 +74,11 @@ namespace UnityAtoms
|
||||
{
|
||||
foreach (var instance in _instances)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
_instances.Remove(instance);
|
||||
continue;
|
||||
}
|
||||
if(instance._startCleared) instance.list.Clear();
|
||||
instance._initial = instance.list.ToList();
|
||||
}
|
||||
@ -82,6 +87,11 @@ namespace UnityAtoms
|
||||
{
|
||||
foreach (var instance in _instances)
|
||||
{
|
||||
if (instance == null) // might be for UnityEngine.Objects
|
||||
{
|
||||
_instances.Remove(instance);
|
||||
continue;
|
||||
}
|
||||
instance.list = instance._initial;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user