Skip to content

Commit

Permalink
Overlay: ProfileSessionListener - fix crash in finializeSession
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Jan 7, 2024
1 parent 4c22255 commit 5bb5870
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Components/Overlay/src/OgreOverlayProfileSessionListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@ namespace Ogre
OverlayContainer* container = dynamic_cast<OverlayContainer*>(mProfileGui);
if (container)
{
for (const auto& p : container->getChildren())
while (!container->getChildren().empty())
{
OverlayElement* element = p.second;
OverlayContainer* parent = element->getParent();
if (parent) parent->removeChild(element->getName());
OverlayElement* element = container->getChildren().cbegin()->second;
container->removeChild(element->getName());
OverlayManager::getSingleton().destroyOverlayElement(element);
}
}
Expand Down

0 comments on commit 5bb5870

Please sign in to comment.