Revert all changes since a36d4918a6f646e085
[platform/upstream/dbus.git] / bus / dir-watch-kqueue.c
index 62f7b3d..4e436eb 100644 (file)
@@ -81,7 +81,6 @@ _handle_kqueue_watch (DBusWatch *watch, unsigned int flags, void *data)
       if (watch != NULL)
        {
          _dbus_loop_remove_watch (loop, watch, _kqueue_watch_callback, NULL);
-          _dbus_watch_invalidate (watch);
           _dbus_watch_unref (watch);
          watch = NULL;
        }
@@ -125,11 +124,10 @@ _init_kqueue (BusContext *context)
                                    NULL, NULL))
           {
             _dbus_warn ("Unable to add reload watch to main loop");
-           _dbus_watch_invalidate (watch);
-           _dbus_watch_unref (watch);
-           watch = NULL;
            close (kq);
            kq = -1;
+           _dbus_watch_unref (watch);
+           watch = NULL;
             goto out;
          }
     }