mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Added helpers for deleting/clearing Lists of RefCounters
This commit is contained in:
@@ -20,5 +20,22 @@ namespace GlitchyEngine
|
||||
value?.ReleaseRef();
|
||||
value = null;
|
||||
}
|
||||
|
||||
public static mixin DeleteContainerAndReleaseItems(var container)
|
||||
{
|
||||
if (container != null)
|
||||
{
|
||||
for (var value in container)
|
||||
value?.ReleaseRef();
|
||||
delete container;
|
||||
}
|
||||
}
|
||||
|
||||
public static mixin ClearAndReleaseItems(var container)
|
||||
{
|
||||
for (var value in container)
|
||||
value?.ReleaseRef();
|
||||
container.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user