Skip to content

Commit 5fb0034

Browse files
authored
Merge pull request #595 from sdslabs/component-array
Fix vector erase bug
2 parents 2b91fa6 + 2aac4d7 commit 5fb0034

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rootex/utility/component_array.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ class ComponentArray
9191
if (m_IsValid[i] && (m_Data[i].getOwner().getID() == entity.getID()))
9292
{
9393
m_IsValid[i] = false;
94+
m_Data[i].onRemove();
95+
m_Data[i].~Component();
96+
memset(&m_Data[i], 0, sizeof(m_Data[i]));
9497
m_ArraySize--;
9598
return true;
9699
}

0 commit comments

Comments
 (0)