aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r--src/lua/lua_common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index 67206b8ef..990be90ef 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -384,12 +384,15 @@ lua_call_expression_func (const gchar *module, const gchar *function,
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 */
@@ -441,6 +444,8 @@ lua_call_expression_func (const gchar *module, const gchar *function,
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;