Skip to content

Commit

Permalink
Fix bug where iterator was used after the underlying item was erased …
Browse files Browse the repository at this point in the history
…from the container (#2412)

Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey authored May 24, 2024
1 parent a3e9f8d commit 07e5d9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/systems/physics/EntityFeatureMap.hh
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ namespace systems::physics_system
if (it != this->entityMap.end())
{
this->reverseMap.erase(it->second);
this->entityMap.erase(it);
this->castCache.erase(_entity);
this->entityMap.erase(it);
return true;
}
return false;
Expand All @@ -242,8 +242,8 @@ namespace systems::physics_system
if (it != this->reverseMap.end())
{
this->entityMap.erase(it->second);
this->reverseMap.erase(it);
this->castCache.erase(it->second);
this->reverseMap.erase(it);
return true;
}
return false;
Expand Down

0 comments on commit 07e5d9c

Please sign in to comment.