Skip to content

Commit d14f490

Browse files
committed
Fix undefined behavior in server CElement::CallEventNoParent
1 parent f0afa3c commit d14f490

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Server/mods/deathmatch/logic/CElement.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,8 @@ void CElement::CallEventNoParent(const char* szName, const CLuaArguments& Argume
10191019
}
10201020

10211021
// Call it on all our children
1022-
for (CElement* pElement : *GetChildrenListSnapshot())
1022+
auto* childrenList = GetChildrenListSnapshot();
1023+
for (CElement* pElement : *childrenList)
10231024
{
10241025
if (!pElement->IsBeingDeleted())
10251026
{

0 commit comments

Comments
 (0)