* glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
the file descriptor list, since it can change under us.
+2003-01-26 Richard Hult <rhult@codefactory.se>
+
+ * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
+ the file descriptor list, since it can change under us.
+
2003-01-25 Anders Carlsson <andersca@codefactory.se>
* glib/dbus-gmain.c: (dbus_connection_prepare),
gpointer user_data)
{
DBusGSource *dbus_source = (DBusGSource *)source;
-
- GList *list;
+ GList *copy, *list;
- list = dbus_source->poll_fds;
+ /* We need to traverse a copy of the list, since it can change in
+ dbus_connect_handle_watch. */
+ copy = g_list_copy (dbus_source->poll_fds);
+ list = copy;
while (list)
{
GPollFD *poll_fd = list->data;
dbus_connection_handle_watch (dbus_source->connection, watch, condition);
}
-
+
list = list->next;
}
+ g_list_free (copy);
+
/* Dispatch messages */
while (dbus_connection_dispatch_message (dbus_source->connection));