From 2a32789c0c431b312908b2b8fad3aa780058a238 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 5 Nov 2009 22:34:21 +0100 Subject: Fix: properly remove devices from collection when usbmuxd terminates ... instead of freeing the collection itself. This fixes the problem with gvfs Volumes not getting removed when unplugging a device and thus increasing the number of devices listed under 'Places' or the save file dialog in GNOME. --- libusbmuxd/libusbmuxd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libusbmuxd/libusbmuxd.c b/libusbmuxd/libusbmuxd.c index d375dd6..f074a5d 100644 --- a/libusbmuxd/libusbmuxd.c +++ b/libusbmuxd/libusbmuxd.c @@ -194,11 +194,10 @@ int get_next_event(int sfd, usbmuxd_event_cb_t callback, void *user_data) // when then usbmuxd connection fails, // generate remove events for every device that // is still present so applications know about it - // TODO: is this behaviour correct? FOREACH(usbmuxd_device_info_t *dev, &devices) { generate_event(callback, dev, UE_DEVICE_REMOVE, user_data); + collection_remove(&devices, dev); } ENDFOREACH - collection_free(&devices); return recv_len; } else if (recv_len == sizeof(hdr)) { if (hdr.message == MESSAGE_DEVICE_ADD) { -- cgit v1.1-32-gdbae