diff --git a/Source/Engine/Engine/NativeInterop.cs b/Source/Engine/Engine/NativeInterop.cs index e6c3f6176..eb37731b7 100644 --- a/Source/Engine/Engine/NativeInterop.cs +++ b/Source/Engine/Engine/NativeInterop.cs @@ -287,10 +287,12 @@ namespace FlaxEngine /// private static class ManagedArrayPool { - private static List> pool = new List>(); + [ThreadStatic] private static List> pool; internal static ManagedArray Get() { + if (pool == null) + pool = new List>(); for (int i = 0; i < pool.Count; i++) { if (!pool[i].Item1)