RealDocs

TWeakPtr::Object

property Core Since 4.0
#include "Templates/SharedPointer.h"
Access: private

Description

Raw pointer to the referenced object. This is a non-owning observation pointer; the object may have already been destroyed even when this is non-null.

Caveats & Gotchas

  • Object being non-null does not mean the referenced object is alive — always use IsValid() or Pin() to safely access the object, never dereference Object directly (it is private).
  • During the intrusive TOptional unset-state sentinel, Object is set to (ObjectType*)-1, which means pointer arithmetic or address comparisons on this field outside of UEOpEquals will give nonsensical results.

Signature

ObjectType* Object

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.