Garbage collection throwing fatal error

I am using the installed 4.5.1. We download a uasset from our server and instantiate it. Once garbage collection happens automatically (or we use GetWorld().ForceGarbageCollection(true)), we get

[2014.10.29-22.50.33:355][454]LogUObjectBase:Error: Class pointer is invalid or CDO is invalid.
[2014.10.29-22.50.33:356][454]LogUObjectBase:Error: Class object failed IsValidLowLevelFast test.
[2014.10.29-22.27.05:170][694]LogUObjectBase:Error: Object flags are invalid or either Class or Outer is misaligned
Fatal error: [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.5\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp] [Line: 273] 
Invalid object in GC: 0x00000000112e7898, ReferencingObject: SkeletalMeshComponent /Game/UEDPIE_0_default.Default:PersistentLevel.ASSET_1895.SkeletalMeshComponent0, ReferencingProperty: ObjectProperty /Script/Engine.SkeletalMeshComponent:SingleAnimationPlayData.VertexAnimToPlay
UE4Editor.exe has triggered a breakpoint.

We have the ability to animate and move the downloaded asset, but once GC runs, it crashes. I am not sure if we are forgetting to set something on our instantiation of the downloaded asset, or anything like that.

Dear DoctorWhy,

#Mark with UPROPERTY()

After you download your asset, are you caching it off to a UPROPERTY() variable?

That will protect it from GC.


IsValidLowLevel() would seem to be indicating that your object is not getting properly initialized.

Can you show your code for actually creating the uasset/object from your downloaded data?


Apparently when setting the FSingleAnimationPlayData for the SkeletalMeshComponent’s AnimationData needs to have both the AnimToPlay and VertexAnimToPlay set to something, even if that something is just nullptr, or GC will fail because it considers the object invalid.