Skip to content

Commit f28bfa9

Browse files
Merge branch 'patch-1' of https://github.com/omar-elhamedy/reactphysics3d into omar-elhamedy-patch-1
2 parents ff20874 + 95cc12d commit f28bfa9

File tree

1 file changed

+4
-2
lines changed
  • include/reactphysics3d/containers

1 file changed

+4
-2
lines changed

include/reactphysics3d/containers/Deque.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,10 @@ class Deque {
296296

297297
clear();
298298

299-
// Release the chunks array
300-
mAllocator.release(mBuffer, sizeof(T) * mCapacity);
299+
if (mBuffer != nullptr && mCapacity > 0) {
300+
// Release the chunks array
301+
mAllocator.release(mBuffer, sizeof(T) * mCapacity);
302+
}
301303

302304
mCapacity = 0;
303305
mBuffer = nullptr;

0 commit comments

Comments
 (0)