We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a696c79 commit 0aaaf0dCopy full SHA for 0aaaf0d
1 file changed
src/Box2D.NET/B2ArenaAllocator.cs
@@ -27,7 +27,7 @@ public B2ArenaAllocator(int capacity)
27
public B2ArenaAllocatorTyped<T> GetOrCreateFor<T>() where T : new()
28
{
29
var index = B2ArenaAllocatorIndexer.Index<T>();
30
- if (_allocators.Length <= index)
+ if (_allocators.Length <= index || null == _allocators[index])
31
32
lock (_lock)
33
@@ -42,13 +42,7 @@ public B2ArenaAllocator(int capacity)
42
43
_allocators = temp;
44
}
45
- }
46
47
-
48
- if (null == _allocators[index])
49
- {
50
- lock (_lock)
51
+
52
// new
53
if (null == _allocators[index])
54
0 commit comments