Skip to content

Commit

Permalink
Fix crash due to cookie object no longer existing for AkEvents when s…
Browse files Browse the repository at this point in the history
…witching scenes
  • Loading branch information
alessandrofama committed Aug 12, 2022
1 parent 0fb355a commit 9821b90
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions wwise-gdnative/src/wwise_gdnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,11 @@ void Wwise::eventCallback(AkCallbackType callbackType, AkCallbackInfo* callbackI
ERROR_CHECK(AK_Fail, "The Event Callback cookie is not valid.");
return;
}
else if (!cookie->is_valid())
{
ERROR_CHECK(AK_Fail, "The Event Callback cookie object no longer exists.");
return;
}

Array args;
Dictionary callbackData;
Expand Down Expand Up @@ -1505,6 +1510,11 @@ void Wwise::bankCallback(AkUInt32 bankID, const void* inMemoryBankPtr, AKRESULT
ERROR_CHECK(AK_Fail, "The Bank Callback cookie is not valid.");
return;
}
else if (!cookie->is_valid())
{
ERROR_CHECK(AK_Fail, "The Bank Callback cookie object no longer exists.");
return;
}

Array args;
Dictionary callbackData;
Expand Down

0 comments on commit 9821b90

Please sign in to comment.