# HG changeset patch # User Thomas Harning Jr # Date 1181526736 0 # Node ID 4d0e9388214a6f7982553ae166417bb48848db11 # Parent 5999243fab1d2b991bbf4c0ba42324fe4a8d9c1b Fixed stack overflow issue. (Forgot to pop error/integer) diff -r 5999243fab1d -r 4d0e9388214a luaevent/src/luaevent.c --- a/luaevent/src/luaevent.c Mon Jun 11 01:24:10 2007 +0000 +++ b/luaevent/src/luaevent.c Mon Jun 11 01:52:16 2007 +0000 @@ -45,6 +45,7 @@ lua_pushinteger(L, event); if(lua_pcall(L, 1, 1, 0) || !lua_isnumber(L, -1)) { printf("ERROR IN CB: %s\n", lua_tostring(L, -1)); + lua_pop(L, 1); freeCallbackArgs(arg); return; } @@ -119,6 +120,7 @@ /* Call the callback with all arguments after it to get the loop primed.. */ if(lua_pcall(L, top - 2, 1, 0) || !lua_isnumber(L, -1)) { printf("ERROR IN INIT: %s\n", lua_tostring(L, -1)); + lua_pop(L, 1); return 0; } ret = lua_tointeger(L, -1);