Skip to content

Commit

Permalink
fix: add game thread execution on pkce dismiss to prevent crash on an…
Browse files Browse the repository at this point in the history
…droid
  • Loading branch information
YermekG committed Feb 20, 2024
1 parent bf0a3e9 commit cfc1df5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Source/Immutable/Private/Immutable/ImmutablePassport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1090,11 +1090,17 @@ void UImmutablePassport::HandleOnLoginPKCEDismissed()
// User hasn't entered all required details (e.g. email address) into
// Passport yet
IMTBL_LOG("Login PKCE dismissed before completing the flow");
if (!PKCEResponseDelegate.ExecuteIfBound(FImmutablePassportResult{ false, "Cancelled" }))
if (FTaskGraphInterface::IsRunning())
{
IMTBL_WARN("Login PKCEResponseDelegate delegate was not called");
FGraphEventRef GameThreadTask = FFunctionGraphTask::CreateAndDispatchWhenReady([this]()
{
if (!PKCEResponseDelegate.ExecuteIfBound(FImmutablePassportResult{ false, "Cancelled" }))
{
IMTBL_WARN("Login PKCEResponseDelegate delegate was not called");
}
PKCEResponseDelegate = nullptr;
}, TStatId(), nullptr, ENamedThreads::GameThread);
}
PKCEResponseDelegate = nullptr;
}
else
{
Expand Down

0 comments on commit cfc1df5

Please sign in to comment.