summaryrefslogtreecommitdiffstats
path: root/glib/dbus-gmain.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-04-25 20:41:49 +0000
committerHavoc Pennington <hp@redhat.com>2003-04-25 20:41:49 +0000
commit9c010fbc04a450cc13484682abfbecd31f610305 (patch)
treeb6f8b0cd5b67dbf3b9772956959d616397097ad9 /glib/dbus-gmain.c
parent3185d7edde8ffc7672aa7d771966b0f1e0158aea (diff)
2003-04-25 Havoc Pennington <hp@redhat.com>
* glib/dbus-gmain.c (remove_watch): fix for a crash when watches were toggled without add/remove, fix from Anders Gustafsson
Diffstat (limited to 'glib/dbus-gmain.c')
-rw-r--r--glib/dbus-gmain.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/glib/dbus-gmain.c b/glib/dbus-gmain.c
index 15490fbd..dd9ea375 100644
--- a/glib/dbus-gmain.c
+++ b/glib/dbus-gmain.c
@@ -275,6 +275,10 @@ remove_watch (DBusWatch *watch,
dbus_source->poll_fds = g_list_remove (dbus_source->poll_fds, poll_fd);
g_hash_table_remove (dbus_source->watches, poll_fd);
g_source_remove_poll ((GSource *)dbus_source, poll_fd);
+
+ dbus_watch_set_data (watch, NULL, NULL); /* needed due to watch_toggled
+ * breaking add/remove symmetry
+ */
g_free (poll_fd);
}