Move GC clearing out of coroutines

This commit is contained in:
Atony committed 2026-07-08 18:13:34 -05:00
1 parent 3eb0a4fdb3
commit 1b718092ee
1 file changed
+3 -10
+3 -10
View File
@@ -326,7 +326,7 @@ public static class Extensions
yield return null;
if (clearGc)
{
yield return CoFreeResources();
ClearGarbageCollector();
}
}
@@ -335,15 +335,8 @@ public static class Extensions
/// </summary>
public static void ClearGarbageCollector()
{
Coroutines.Start(CoFreeResources());
}
private static IEnumerator CoFreeResources()
{
yield return Resources.UnloadUnusedAssets();
GC.WaitForPendingFinalizers();
GC.Collect(0, GCCollectionMode.Forced);
Resources.UnloadUnusedAssets();
GC.Collect();
}
/// <summary>