summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {