summaryrefslogtreecommitdiff
path: root/src/Bullet3Common/b3AlignedObjectArray.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Bullet3Common/b3AlignedObjectArray.h')
-rw-r--r--src/Bullet3Common/b3AlignedObjectArray.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Bullet3Common/b3AlignedObjectArray.h b/src/Bullet3Common/b3AlignedObjectArray.h
index 7d31b56d0..8ef3331f7 100644
--- a/src/Bullet3Common/b3AlignedObjectArray.h
+++ b/src/Bullet3Common/b3AlignedObjectArray.h
@@ -135,7 +135,11 @@ public:
int otherSize = otherArray.size();
resize(otherSize);
- otherArray.copy(0, otherSize, m_data);
+ //don't use otherArray.copy, it can leak memory
+ for (int i = 0; i < otherSize; i++)
+ {
+ m_data[i] = otherArray[i];
+ }
}
/// return the number of elements in the array
@@ -506,7 +510,11 @@ public:
{
int otherSize = otherArray.size();
resize(otherSize);
- otherArray.copy(0, otherSize, m_data);
+ //don't use otherArray.copy, it can leak memory
+ for (int i = 0; i < otherSize; i++)
+ {
+ m_data[i] = otherArray[i];
+ }
}
void removeAtIndex(int index)