Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/TWeakObjectPtr
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool IsValid () |
Test if this points to a live UObject. | UObject/WeakObjectPtrTemplates.h | |
bool IsValid
(
bool bEvenIfPendingKill, |
Test if this points to a live UObject. | UObject/WeakObjectPtrTemplates.h |
IsValid()
Description
Test if this points to a live UObject. This is an optimized version implying bEvenIfPendingKill=false, bThreadsafeTest=false. This should be done only when needed as excess resolution of the underlying pointer can cause performance issues. Note that IsValid can not be used on another thread as it will incorrectly return false during the mark phase of the GC due to the Unreachable flag being set. (see bThreadsafeTest above)
| Name | IsValid |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/UObject/WeakObjectPtrTemplates.h |
| Include Path | #include "UObject/WeakObjectPtrTemplates.h" |
bool IsValid() const
true if Get() would return a valid non-null pointer
IsValid(bool, bool)
Description
Test if this points to a live UObject. This should be done only when needed as excess resolution of the underlying pointer can cause performance issues.
| Name | IsValid |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/UObject/WeakObjectPtrTemplates.h |
| Include Path | #include "UObject/WeakObjectPtrTemplates.h" |
bool IsValid
(
bool bEvenIfPendingKill,
bool bThreadsafeTest
) const
true if Get() would return a valid non-null pointer
Parameters
| Name | Remarks |
|---|---|
| bEvenIfPendingKill | if this is true, pendingkill objects are considered valid |
| bThreadsafeTest | if true then function will just give you information whether referenced UObject is gone forever (return false) or if it is still there (return true, no object flags checked). This is required as without it IsValid can return false during the mark phase of the GC due to the presence of the Unreachable flag. |