eldbus: Reset value of fd_handler after deletion
authorEduardo Lima (Etrunko) <eduardo.lima@intel.com>
Mon, 27 May 2013 21:17:54 +0000 (18:17 -0300)
committerEduardo Lima (Etrunko) <eduardo.lima@intel.com>
Tue, 28 May 2013 12:42:29 +0000 (09:42 -0300)
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
src/lib/eldbus/eldbus_core.c

index c2b3b57..3c8217f 100644 (file)
@@ -635,8 +635,15 @@ cb_watch_toggle(DBusWatch *watch, void *data EINA_UNUSED)
    hd->enabled = dbus_watch_get_enabled(watch);
 
    DBG("watch %p is %sabled", hd, hd->enabled ? "en" : "dis");
-   if (hd->enabled) eldbus_fd_handler_add(hd);
-   else ecore_main_fd_handler_del(hd->fd_handler);
+   if (hd->enabled)
+     {
+        eldbus_fd_handler_add(hd);
+     }
+   else
+     {
+        ecore_main_fd_handler_del(hd->fd_handler);
+        hd->fd_handler = NULL;
+     }
 }
 
 static void