Fix timeout handling
authorlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 25 Jul 2012 02:25:35 +0000 (02:25 +0000)
committerlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 25 Jul 2012 02:25:35 +0000 (02:25 +0000)
A "if" in timeout callback is wrong and this way when a
timeout happens this is not handled correctly.

Change the return value of the callback so it doesn't get called
indefinitely, too.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@74363 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/dbus/e_dbus.c

index 5714df4..06f83b6 100644 (file)
@@ -231,7 +231,7 @@ e_dbus_timeout_handler(void *data)
 
   td = data;
 
-  if (dbus_timeout_get_enabled(td->timeout)) 
+  if (!dbus_timeout_get_enabled(td->timeout))
   {
     DBG("timeout_handler (not enabled, ending)");
     td->handler = NULL;
@@ -240,7 +240,7 @@ e_dbus_timeout_handler(void *data)
 
   DBG("timeout handler!");
   dbus_timeout_handle(td->timeout);
-  return ECORE_CALLBACK_RENEW;
+  return ECORE_CALLBACK_CANCEL;
 }
 
 static void