Skip to content

Commit

Permalink
Merge pull request #595 from sdslabs/component-array
Browse files Browse the repository at this point in the history
Fix vector erase bug
  • Loading branch information
r41k0u authored Aug 24, 2023
2 parents 2b91fa6 + 2aac4d7 commit 5fb0034
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rootex/utility/component_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ class ComponentArray
if (m_IsValid[i] && (m_Data[i].getOwner().getID() == entity.getID()))
{
m_IsValid[i] = false;
m_Data[i].onRemove();
m_Data[i].~Component();
memset(&m_Data[i], 0, sizeof(m_Data[i]));
m_ArraySize--;
return true;
}
Expand Down

0 comments on commit 5fb0034

Please sign in to comment.