Merge pull request #38 from defold/issue-35-crash-on-iap-oncommand

Get the Lua context from the callback and not the listener
This commit is contained in:
Björn Ritzl 2021-04-28 10:06:24 +02:00 committed by GitHub
commit f3ee2361ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,7 +169,7 @@ static void HandleProductResult(IAPCommand* cmd)
IAPResponse* response = (IAPResponse*)cmd->m_Data; IAPResponse* response = (IAPResponse*)cmd->m_Data;
lua_State* L = dmScript::GetCallbackLuaContext(g_IAP.m_Listener); lua_State* L = dmScript::GetCallbackLuaContext(cmd->m_Callback);
int top = lua_gettop(L); int top = lua_gettop(L);
if (!dmScript::SetupCallback(cmd->m_Callback)) if (!dmScript::SetupCallback(cmd->m_Callback))