fix crash
This commit is contained in:
parent
6056ff8eeb
commit
1a778d0e98
@ -277,11 +277,7 @@ static void HandleProductResult(const IAPCommand* cmd)
|
||||
IAP_PushError(L, "failed to fetch product", REASON_UNSPECIFIED);
|
||||
}
|
||||
|
||||
int ret = lua_pcall(L, 3, 0, 0);
|
||||
if (ret != 0) {
|
||||
dmLogError("Error running callback: %s", lua_tostring(L, -1));
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
dmScript::PCall(L, 3, 0);
|
||||
|
||||
dmScript::TeardownCallback(cmd->m_Callback);
|
||||
dmScript::DestroyCallback(cmd->m_Callback);
|
||||
@ -335,11 +331,7 @@ static void HandlePurchaseResult(const IAPCommand* cmd)
|
||||
IAP_PushError(L, "failed to buy product", REASON_UNSPECIFIED);
|
||||
}
|
||||
|
||||
int ret = dmScript::PCall(L, 3, 0);
|
||||
if (ret != 0) {
|
||||
dmLogError("Error running callback: %s", lua_tostring(L, -1));
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
dmScript::PCall(L, 3, 0);
|
||||
|
||||
dmScript::TeardownCallback(cmd->m_Callback);
|
||||
|
||||
|
@ -71,8 +71,7 @@ static void IAPList_Callback(void* luacallback, const char* result_json)
|
||||
IAP_PushError(L, "Got empty list result.", REASON_UNSPECIFIED);
|
||||
}
|
||||
|
||||
int ret = dmScript::PCall(L, 3, 0);
|
||||
(void)ret;
|
||||
dmScript::PCall(L, 3, 0);
|
||||
|
||||
dmScript::DestroyCallback(callback);
|
||||
dmScript::TeardownCallback(callback);
|
||||
@ -144,8 +143,7 @@ static void IAPListener_Callback(void* luacallback, const char* result_json, int
|
||||
}
|
||||
}
|
||||
|
||||
int ret = dmScript::PCall(L, 3, 0);
|
||||
(void)ret;
|
||||
dmScript::PCall(L, 3, 0);
|
||||
|
||||
dmScript::TeardownCallback(callback);
|
||||
}
|
||||
|
@ -186,11 +186,7 @@ static void HandleProductResult(IAPCommand* cmd)
|
||||
}
|
||||
lua_pushnil(L);
|
||||
|
||||
int ret = dmScript::PCall(L, 3, 0);
|
||||
if (ret != 0) {
|
||||
dmLogError("%d: Error running callback: %s", __LINE__, lua_tostring(L, -1));
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
dmScript::PCall(L, 3, 0);
|
||||
|
||||
dmScript::TeardownCallback(cmd->m_Callback);
|
||||
dmScript::DestroyCallback(cmd->m_Callback);
|
||||
@ -318,11 +314,7 @@ static void HandlePurchaseResult(IAPCommand* cmd)
|
||||
lua_pushnil(L);
|
||||
}
|
||||
|
||||
int ret = dmScript::PCall(L, 3, 0);
|
||||
if (ret != 0) {
|
||||
dmLogError("%d: Error running callback: %s", __LINE__, lua_tostring(L, -1));
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
dmScript::PCall(L, 3, 0);
|
||||
|
||||
dmScript::TeardownCallback(cmd->m_Callback);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user