It's a great way to add detail on how you're using it. TWeakObjectPtr doesn't prevent GC and becomes NULL when the underlying object is destroyed. TSharedPtr, TSharedRef, TWeakPtr, TUniquePtr Drawing the line Not compatible with UObject
Your might have heard the story about how using Unreal's smart pointers ( TSharedPtr, TSharedRef, TWeakPtr, TUniquePtr) causes unexpected results on UObjects, because the UObject memory management system is geared for game code, which is much more garbage collection oriented.Ī clear distinction between what is exposed to the uobject memory management system and what not must not be foreign. How does Unreal's smart pointer library work with UObjects? Let's establish a clear distinction.