Always remove, invalidate and free watches before closing watched sockets
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 21 Jan 2011 18:51:27 +0000 (18:51 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 13 Jun 2011 14:45:54 +0000 (15:45 +0100)
commit58f968a2cc700377fc668dcaed4bc94a2ea7ca88
treea9f63e16ff92a316a9a741cc348d576daec6de62
parenta2e330980d6b7975dfea5b7d798e9bd55b80241c
Always remove, invalidate and free watches before closing watched sockets

This should mean we don't get invalid fds in the main loop.

The BSD (kqueue) and Windows code paths are untested, but follow the same
patterns as the tested Linux/generic Unix versions.

DBusTransportSocket was already OK (it called free_watches() before
_dbus_close_socket, and that did the remove, invalidate, unref dance).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
bus/dir-watch-inotify.c
bus/dir-watch-kqueue.c
bus/main.c
dbus/dbus-mainloop.c
dbus/dbus-server-socket.c
dbus/dbus-spawn-win.c
dbus/dbus-spawn.c
dbus/dbus-transport-socket.c