I believe I’ve solved the problem, new answer to be upvoted. Short answer is it has been fixed since 4.7
Larger explanation.
Look in the function FArchiveRealtimeGC::PerformReachabilityAnalysis
there are two ways this special UObject gets added to the ObjectsToSerialize
array.
The common way is that it is a RF_RootSet
object and therefore has special code for handling that
if( Object->HasAnyFlags( RF_RootSet ) )
But the problem lay with the iterator that controls this loop
for ( FRawObjectIterator It(true); It; ++It )
This iterator only operates on UObjects greater than the “is disregard for GC” count which is the total of all UObjects that exist at the end of engine init. This is an optimization that says “these objects will never GC so never consider them”. But if the GCObjectReferencer is under that index/number then it won’t get added via this code path.
So just above the iterator is some new code, code I believe you are missing.
// Make sure GC referencer object is checked for references to other objects even if it resides in permanent object pool
if (FPlatformProperties::RequiresCookedData() && FGCObject::GGCObjectReferencer && GetUObjectArray().IsDisregardForGC(FGCObject::GGCObjectReferencer))
{
ObjectsToSerialize.Add(FGCObject::GGCObjectReferencer);
}
Which is making sure this object is considered if it is below that number. DefaultEngine.ini for ShooterGame sets the number to 50000, so the iterator is skipping this very important object.
[Core.System]
MaxObjectsNotConsideredByGC=50000
CL#2446988 would be your fix.
So sorry this took so long. Fortnite has that MaxObjectsNotConsideredByGC
value set to 0, so this new code was never needed.
I hope this solves your problem and we can all go home now.