From a34cdc39945def7770072392af94dd1368bd809b Mon Sep 17 00:00:00 2001 From: ken-water Date: Wed, 25 Apr 2018 00:38:06 +0800 Subject: [PATCH] fix bug: pops one element from the stack when lua_istable return zero. --- .gitignore | 2 ++ lua/tolua/tolua_event.c | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..1f74ea418f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +#for macos +.DS_Store diff --git a/lua/tolua/tolua_event.c b/lua/tolua/tolua_event.c index 15adbc04b3..8af7c28452 100644 --- a/lua/tolua/tolua_event.c +++ b/lua/tolua/tolua_event.c @@ -158,6 +158,8 @@ static int class_table_get_index (lua_State* L) return 1; } lua_pop(L, 2); + } else { + lua_pop(L, 1); } } lua_pushnil(L);