From: Eduardo Felipe <eduardofelipe87@gmail.com>
authorEduardo Felipe <eduardofelipe87@gmail.com>
Thu, 20 May 2010 04:48:17 +0000 (04:48 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 20 May 2010 04:48:17 +0000 (04:48 +0000)
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: http://svn.enlightenment.org/svn/e/trunk/edje@49051 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_lua.c

index 685ef81..d0480fe 100644 (file)
@@ -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
    
 /*