Download

Can't garbage collection work with expanded class?

I added one int field in UPrimitiveComponent class (to have opportunity to identify easily actor’s component when LineTrace return pointer to UPrimitiveComponent).
But after destroying UCapsuleComponent garbage collection crush the game.
Can’t I just expand UE4 standart class without inheritance?
I guess GC don’t know new size of UPrimitiveComponent class (coz i add 4 bytes) or does it work another way?




Fatal error : [File:D: / Build / ++UE4 + Licensee / Sync / Engine / Source / Runtime / CoreUObject / Private / UObject / GarbageCollection.cpp] [Line:903] Invalid object in GC : 0x0000027e0000000a, ReferencingObject : CapsuleComponent / Game / StarterContent / Maps / UEDPIE_0_Minimal_Default.Minimal_Default : PersistentLevel.MainBP_2.NODE_AddCapsuleComponent - 1_5, ReferencingObjectClass : Class / Script / Engine.CapsuleComponent, Property Name : ShapeBodySetup, Offset : 1160, TokenIndex : 19

UE4Editor_CoreUObject!TFastReferenceCollector<1, FGCReferenceProcessor<1, 0>, FGCCollector<1, 0>, FGCArrayPool, 0, 1>::ProcessObjectArray()[D:\Build\++UE4 + Licensee\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\FastReferenceCollector.h:675]
UE4Editor_CoreUObject!TFastReferenceCollector<1, FGCReferenceProcessor<1, 0>, FGCCollector<1, 0>, FGCArrayPool, 0, 1>::FCollectorTaskQueue::DoTask()[D:\Build\++UE4 + Licensee\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\FastReferenceCollector.h:383]
UE4Editor_CoreUObject!TGraphTask, FGCCollector<1, 0>, FGCArrayPool, 0, 1 > ::FCollectorTaskProcessorTask > ::ExecuteTask()[D:\Build\++UE4 + Licensee\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:849]
UE4Editor_Core!FTaskThreadAnyThread::ProcessTasks()[D:\Build\++UE4 + Licensee\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:1039]
UE4Editor_Core!FTaskThreadAnyThread::ProcessTasksUntilQuit()[D:\Build\++UE4 + Licensee\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:863]
UE4Editor_Core!FTaskThreadAnyThread::Run()[D:\Build\++UE4 + Licensee\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:940]
UE4Editor_Core!FRunnableThreadWin::Run()[D:\Build\++UE4 + Licensee\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:86]