Browse Source

Disable aggressive GC, more fun with modifying while iterating

Josh Engebretson 9 years ago
parent
commit
3791f064e7

+ 2 - 0
Script/AtomicNET/AtomicNET/Core/NativeCore.cs

@@ -156,9 +156,11 @@ namespace AtomicEngine
 
 
 
 
                 // TODO: tune GC
                 // TODO: tune GC
+                /*
                 GC.Collect();
                 GC.Collect();
                 GC.WaitForPendingFinalizers();
                 GC.WaitForPendingFinalizers();
                 GC.Collect();
                 GC.Collect();
+                */
 
 
                 ExpireNatives();
                 ExpireNatives();
             }
             }

+ 2 - 2
Script/AtomicNET/AtomicNET/Scene/Scene.cs

@@ -81,7 +81,7 @@ namespace AtomicEngine
 
 
             Object[] args = new Object[1] { e.TimeStep };
             Object[] args = new Object[1] { e.TimeStep };
 
 
-            foreach (var item in cscomponents)
+            foreach (var item in cscomponents.ToList())
             {
             {
                 var info = item.Key;
                 var info = item.Key;
 
 
@@ -90,7 +90,7 @@ namespace AtomicEngine
                 if (UpdateMethod == null)
                 if (UpdateMethod == null)
                     continue;
                     continue;
 
 
-                foreach (var csc in item.Value)
+                foreach (var csc in item.Value.ToList())
                 {
                 {
                     if (!csc.Started || !csc.IsEnabled())
                     if (!csc.Started || !csc.IsEnabled())
                         continue;
                         continue;