From: Krisztian Litkey Date: Tue, 28 Oct 2014 12:48:34 +0000 (+0200) Subject: lua-timer: explicitly restore Lua stack across callbacks. X-Git-Tag: v0.0.63~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18fb3de745211092ba2380744e8f67f958076939;p=profile%2Fivi%2Fmurphy.git lua-timer: explicitly restore Lua stack across callbacks. --- diff --git a/src/core/lua-bindings/lua-timer.c b/src/core/lua-bindings/lua-timer.c index 0fa5b4d..eb87494 100644 --- a/src/core/lua-bindings/lua-timer.c +++ b/src/core/lua-bindings/lua-timer.c @@ -107,9 +107,12 @@ static void timer_lua_cb(mrp_timer_t *timer, void *user_data) { timer_lua_t *t = (timer_lua_t *)user_data; int one = t->oneshot; + int top; MRP_UNUSED(timer); + top = lua_gettop(t->L); + if (mrp_lua_object_deref_value(t, t->L, t->callback, false)) { mrp_lua_push_object(t->L, t); @@ -124,6 +127,8 @@ static void timer_lua_cb(mrp_timer_t *timer, void *user_data) mrp_del_timer(t->t); t->t = NULL; } + + lua_settop(t->L, top); }