Bug in "UCancellableAsyncAction::IsActive()"

The function “UCancellableAsyncAction::IsActive()” relies in the end on the variable “RegisteredWithGameInstance” which is never reset when calling “UBlueprintAsyncActionBase::SetReadyToDestroy()” so even if we cancel or call “SetReadyToDestroy”, after that calling “IsActive” on the async action will always return true.

Steps to Reproduce
Please read the description

Hello,

Would you be able to provide repro steps and/or a repro project for this issue? This will aid us in putting together a bug report, if necessary.

Take care,

John

Hi John,

The issue is like I described mainly.

You can create a cancellable async action (done in C++ and derived from this class for instance) in blueprint that registers itself to the game instance, keep a variable to the async action outputted, complete or cancel the async action and then query “IsActive” on the async action. It will return true even though the comment says:

“Returns true if this action is still active and has not completed or been cancelled”

The problem like I said is that the “IsActive” funcion relies on the function “ShouldBroadcastDelegates” which relies on the variable “RegisteredWithGameInstance” which is not reset when calling “SetReadyToDestroy”, so it remains always valid as long as the game instance exists. For our project, I fixed the issue by simply calling “RegisteredWithGameInstance.Reset()” in “UBlueprintAsyncActionBase::SetReadyToDestroy()” when we detach from the game instance.

Hi Jean-Philippe,

Thank you for the additional context.

Upon further investigation, this issue appears to have been reported previously, with a fix targeted for a later release: Unreal Engine Issues and Bug Tracker (UE\-218820\).

Take care,

John

Thank you very much John!