From 089d227434fa29594c004572eedb23b1054e34b2 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Mon, 10 Aug 2020 00:03:35 +0200 Subject: [PATCH] Fix issue in List class --- include/reactphysics3d/containers/List.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/reactphysics3d/containers/List.h b/include/reactphysics3d/containers/List.h index 140f0b56..2274657f 100755 --- a/include/reactphysics3d/containers/List.h +++ b/include/reactphysics3d/containers/List.h @@ -313,7 +313,7 @@ class List { void addWithoutInit(uint nbElements) { // If we need to allocate more memory - if (mSize == mCapacity) { + if ((mSize + nbElements) > mCapacity) { reserve(mCapacity == 0 ? nbElements : (mCapacity + nbElements) * 2); }