summaryrefslogtreecommitdiffstats
path: root/libusbmuxd
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-11-05 22:34:21 +0100
committerGravatar Nikias Bassen2009-11-05 22:34:21 +0100
commit2a32789c0c431b312908b2b8fad3aa780058a238 (patch)
tree218c86f9acd8c2117174d3da1171de2e632a9e35 /libusbmuxd
parent384d76f27cc431f91e49b0ebfcc3fbdb1e2aa34f (diff)
downloadusbmuxd-1.0.0.tar.gz
usbmuxd-1.0.0.tar.bz2
Fix: properly remove devices from collection when usbmuxd terminatesv1.0.0
... 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.
Diffstat (limited to 'libusbmuxd')
-rw-r--r--libusbmuxd/libusbmuxd.c3
1 files changed, 1 insertions, 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) {