From e0f17f8931eae1d50bb60a711f657eb4c9a87338 Mon Sep 17 00:00:00 2001 From: "kimixuchen@163.com" Date: Sat, 30 May 2020 10:56:58 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2uclass=E8=A2=ABgc=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=AF=AF=E6=B8=85=E5=9C=A8mark=E5=92=8Csweeep?= =?UTF-8?q?=E4=B9=8B=E9=97=B4=E6=96=B0=E5=BB=BA=E7=9A=84=E5=90=8C=E5=90=8D?= =?UTF-8?q?uclass=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UnLua/Private/ReflectionUtils/ReflectionRegistry.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Plugins/UnLua/Source/UnLua/Private/ReflectionUtils/ReflectionRegistry.cpp b/Plugins/UnLua/Source/UnLua/Private/ReflectionUtils/ReflectionRegistry.cpp index dbc0f2d6..4513635a 100644 --- a/Plugins/UnLua/Source/UnLua/Private/ReflectionUtils/ReflectionRegistry.cpp +++ b/Plugins/UnLua/Source/UnLua/Private/ReflectionUtils/ReflectionRegistry.cpp @@ -124,7 +124,11 @@ bool FReflectionRegistry::NotifyUObjectDeleted(const UObjectBase *InObject) { UE_LOG(LogUnLua, Warning, TEXT("Class/ScriptStruct %s has been GCed by engine!!!"), *ClassDesc->GetName()); ClassDesc->Reset(); - Name2Classes.Remove(ClassDesc->GetFName()); + FClassDesc** PClassDesc = Name2Classes.Find(ClassDesc->GetFName()); + if (PClassDesc && *PClassDesc == ClassDesc) + { + Name2Classes.Remove(ClassDesc->GetFName()); + } Struct2Classes.Remove(Struct); return true; }