summaryrefslogtreecommitdiffstats
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
parent384d76f27cc431f91e49b0ebfcc3fbdb1e2aa34f (diff)
downloadusbmuxd-2a32789c0c431b312908b2b8fad3aa780058a238.tar.gz
usbmuxd-2a32789c0c431b312908b2b8fad3aa780058a238.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.
-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)
194 // when then usbmuxd connection fails, 194 // when then usbmuxd connection fails,
195 // generate remove events for every device that 195 // generate remove events for every device that
196 // is still present so applications know about it 196 // is still present so applications know about it
197 // TODO: is this behaviour correct?
198 FOREACH(usbmuxd_device_info_t *dev, &devices) { 197 FOREACH(usbmuxd_device_info_t *dev, &devices) {
199 generate_event(callback, dev, UE_DEVICE_REMOVE, user_data); 198 generate_event(callback, dev, UE_DEVICE_REMOVE, user_data);
199 collection_remove(&devices, dev);
200 } ENDFOREACH 200 } ENDFOREACH
201 collection_free(&devices);
202 return recv_len; 201 return recv_len;
203 } else if (recv_len == sizeof(hdr)) { 202 } else if (recv_len == sizeof(hdr)) {
204 if (hdr.message == MESSAGE_DEVICE_ADD) { 203 if (hdr.message == MESSAGE_DEVICE_ADD) {