From 459b3c83355ccad3271309d86481652012bb380f Mon Sep 17 00:00:00 2001 From: raster Date: Thu, 20 May 2010 04:48:17 +0000 Subject: [PATCH] From: Eduardo Felipe Upon creating a timer, it's callback must return an int, otherwise it would panic. The python bindings do the nicety of, if the callback function returns nothing, automatically canceling the reschedule of the timer. This patch does the same for lua. It's a oneliner. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@49051 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_lua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/edje_lua.c b/src/lib/edje_lua.c index 685ef81..d0480fe 100644 --- a/src/lib/edje_lua.c +++ b/src/lib/edje_lua.c @@ -863,7 +863,7 @@ _edje_lua_timer_cb(void *data) return 0; } - res = luaL_checkint(L, -1); + res = luaL_optint(L, -1, ECORE_CALLBACK_CANCEL); lua_pop(L, 1); // -- res /* -- 2.7.4