[New Wiki] Memory Management, Count References to Any Object, and Know Who is Referring!

IsReferenced function will set UE::GC::GUnreachableObjectFlag for unreachable objects, which will mess up ordinary GC flow. You can see that VerifyObjectFlags function will be called when GC starts to check that each object should not contain UE::GC::GUnreachableObjectFlag and UE::GC::GMaybeUnreachableObjectFlag.

After searching source code, I find that IsReferenced is only used by unreal editor, and there is no automatic GC before you click PIE. So I guess that unreal editor may do something like garbage purge after using IsReferenced function to keep things work.

For a safer choice, I would suggest to use FReferencerFinder::GetAllReferencers to find all objects that reference given objects, even though it don’t provide detailed reference counting and reference property.