Yes. UObjects are garbage collected by another system, not allocated and owned by the TStrongObjectPtr
in the same way as with a unique pointer. For UObjects, the Strong Ptr modifies a reference count on the the UObject itself which prevents the object from being destroyed purely for garbage collection reasons.
However, TStrongObjectPtr aren’t entirely foolproof since they can’t keep a UObject alive that otherwise has to be destroyed for some other reason. If you call AActor::Destroy
or UActorComponent::DestroyComponent
, those objects are going to go away no matter how many strong pointers you have pointing at them.
They are perfectly safe to copy.