Navigation
API > API/Runtime > API/Runtime/CoreUObject > API/Runtime/CoreUObject/UObject > API/Runtime/CoreUObject/UObject/FWeakObjectPtr > API/Runtime/CoreUObject/UObject/FWeakObjectPtr/IsValid
References
| Module | CoreUObject |
| Header | /Engine/Source/Runtime/CoreUObject/Public/UObject/WeakObjectPtr.h |
| Include | #include "UObject/WeakObjectPtr.h" |
| Source | /Engine/Source/Runtime/CoreUObject/Private/UObject/WeakObjectPtr.cpp |
bool IsValid
(
bool bEvenIfGarbage,
bool bThreadsafeTest
) const
Remarks
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. true if Get() would return a valid non-null pointer
Parameters
| Name | Description |
|---|---|
| bEvenIfGarbage | if this is true, Garbage objects are considered invalid |
| 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. |