Navigation
API > API/Runtime > API/Runtime/CoreUObject > API/Runtime/CoreUObject/FWeakObjectPtr
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool IsValid () |
Test if this points to a live UObject. | UObject/WeakObjectPtr.h | |
bool IsValid
(
bool bEvenIfGarbage, |
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. | UObject/WeakObjectPtr.h |
IsValid()
Description
Test if this points to a live UObject. This is an optimized version implying bEvenIfGarbage=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/CoreUObject/Public/UObject/WeakObjectPtr.h |
| Include Path | #include "UObject/WeakObjectPtr.h" |
| Source | /Engine/Source/Runtime/CoreUObject/Private/UObject/WeakObjectPtr.cpp |
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/CoreUObject/Public/UObject/WeakObjectPtr.h |
| Include Path | #include "UObject/WeakObjectPtr.h" |
| Source | /Engine/Source/Runtime/CoreUObject/Private/UObject/WeakObjectPtr.cpp |
bool IsValid
(
bool bEvenIfGarbage,
bool bThreadsafeTest
) const
true if Get() would return a valid non-null pointer
Parameters
| Name | Remarks |
|---|---|
| bEvenIfGarbage | if this is true, Garbage objects are considered valid. When false, an object is considered invalid as soon as it is marked for destruction. |
| 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. |