Skip to content

Commit

Permalink
Main: fix crash in the ControllerManager::updateAllControllerswhen mC…
Browse files Browse the repository at this point in the history
…ontrollers is changed while iterating over it (#3216)
  • Loading branch information
Altren authored Sep 8, 2024
1 parent cf0f1e9 commit 68fd612
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion OgreMain/src/OgreControllerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ namespace Ogre {
unsigned long thisFrameNumber = Root::getSingleton().getNextFrameNumber();
if (thisFrameNumber != mLastFrameNumber)
{
for (auto *ci : mControllers)
auto controllersCopy = mControllers;
for (auto *ci : controllersCopy)
{
ci->update();
}
Expand Down

0 comments on commit 68fd612

Please sign in to comment.