Software EngineeringOpen accessPublished 3 Oct 2026
Manage UObject lifetime and plain C++ memory in Unreal Engine. Covers the garbage collector reachability cycle and root set, keeping UObjects alive with UPROPERTY() raw pointers, non-owning TWeakObjectPtr, path-only TSoftObjectPtr, TStrongObjectPtr for non-UObject owners, FGCObject::AddReferencedObjects, AddToRoot/RemoveFromRoot, MarkPendingKill and IsValid checks, and the non-UObject smart pointers TSharedPtr/TSharedRef/TWeakPtr/TUniquePtr and MakeShared. Use when choosing a pointer or ownership type, debugging crashes after garbage collection, investigating dangling pointer or use-after-free bugs, holding UObjects from non-UObject classes, or picking between TSharedPtr …