FWeakObjectPtr::IsStale

Slightly different than !IsValid(), returns true if this used to point to a [UObject](API\Runtime\CoreUObject\UObject\UObject), but doesn't any more and has not been assigned or reset in the mean time.

Windows
MacOS
Linux

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

Syntax

bool IsStale
(
    bool bIncludingIfPendingKill,
    bool bThreadsafeTest
) const

Remarks

Slightly different than !IsValid(), returns true if this used to point to a UObject, but doesn't any more and has not been assigned or reset in the mean time.

Returns

true if this used to point at a real object but no longer does.

Parameters

Parameter

Description

bIncludingIfPendingKill

if this is false, pendingkill objects are not considered stale

bThreadsafeTest

set it to true when testing outside of Game Thread. Results in false if WeakObjPtr point to an existing object (no flags checked)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss