Try to avoid crashes if memory allocations fail
Deal with cases exceeding allocations of bodies/shapes above the limits set in b3Config (work-in-progress )
This commit is contained in:
@@ -303,7 +303,12 @@ protected:
|
||||
{ // not enough room, reallocate
|
||||
T* s = (T*)allocate(_Count);
|
||||
b3Assert(s);
|
||||
|
||||
if (s==0)
|
||||
{
|
||||
b3Error("b3AlignedObjectArray reserve out-of-memory\n");
|
||||
_Count=0;
|
||||
m_size=0;
|
||||
}
|
||||
copy(0, size(), s);
|
||||
|
||||
destroy(0,size());
|
||||
|
||||
Reference in New Issue
Block a user