We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 725246d commit 08b5392Copy full SHA for 08b5392
Plugins/UnLua/Source/UnLua/Private/LuaOverridesClass.cpp
@@ -49,6 +49,10 @@ void ULuaOverridesClass::SetActive(const bool bActive)
49
}
50
51
Class->ClearFunctionMapsCaches();
52
+ if (bActive)
53
+ AddToOwner();
54
+ else
55
+ RemoveFromOwner();
56
57
58
void ULuaOverridesClass::BeginDestroy()
@@ -71,8 +75,17 @@ void ULuaOverridesClass::AddToOwner()
71
75
auto Field = &(Class->Children);
72
76
#endif
73
77
while (*Field)
78
+ {
79
+ if (*Field == this)
80
81
+ Field = nullptr;
82
+ break;
83
+ }
74
84
Field = &(*Field)->Next;
- *Field = this;
85
86
+
87
+ if (Field)
88
+ *Field = this;
89
90
if (Class->IsRooted() || GUObjectArray.IsDisregardForGC(Class))
91
AddToRoot();
0 commit comments