1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-02 20:43:35 +00:00

Fix crash on lovr.event.quit("restart")

This commit is contained in:
mcc 2020-04-15 17:59:25 -04:00
parent 936766bd22
commit 334077c9f8

View file

@ -511,7 +511,7 @@ void bridgeLovrUpdate(BridgeLovrUpdateData *updateData) {
luax_clearerror(T); luax_clearerror(T);
lovrSetErrorCallback(luax_vthrow, T); lovrSetErrorCallback(luax_vthrow, T);
if (lua_resume(T, 1) != LUA_YIELD) { if (lua_resume(T, 1) != LUA_YIELD) {
if (lua_type(T, -1) == LUA_TSTRING && !strcmp(lua_tostring(T, -1), "restart")) { if (lua_type(T, -2) == LUA_TSTRING && !strcmp(lua_tostring(T, -2), "restart")) {
state.renderCallback = NULL; state.renderCallback = NULL;
state.renderUserdata = NULL; state.renderUserdata = NULL;
lua_close(L); lua_close(L);