lua_pop (L, 1);
lua_getglobal (L, function);
}
- else {
+ else if (lua_istable (L, -1)) {
/* Call local function in table */
lua_pushstring (L, function);
lua_gettable (L, -2);
pop += 2;
}
+ else {
+ msg_err ("Bad type: %s for function: %s for module: %s", lua_typename (L, lua_type (L, -1)), function, module);
+ }
}
else {
/* Try to get global variable */
return FALSE;
}
*res = lua_toboolean (L, -1);
+ lua_gc (L, LUA_GCCOLLECT, 0);
+ msg_info ("lua eats %d kbytes", lua_gc (L, LUA_GCCOUNT, 0));
lua_pop (L, pop);
return TRUE;