2
0
Эх сурвалжийг харах

Detect attempt to copy a base class's attributes onto itself, and early-exit in that case.

Lasse Öörni 10 жил өмнө
parent
commit
77e6703b15

+ 4 - 0
Source/Urho3D/Core/Context.cpp

@@ -164,6 +164,10 @@ VariantMap& Context::GetEventDataMap()
 
 void Context::CopyBaseAttributes(StringHash baseType, StringHash derivedType)
 {
+    // Prevent endless loop if mistakenly copying attributes from same class as derived
+    if (baseType == derivedType)
+        return;
+
     const Vector<AttributeInfo>* baseAttributes = GetAttributes(baseType);
     if (baseAttributes)
     {