From b5452c877ae96679c425ab97dff394b2840b6e82 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 11 Feb 2013 20:29:58 +0100 Subject: usb-device-manager: Fix coldplug race It is possible for us to see a device show up twice, if it gets plugged in between us starting listening for new devices and doing "coldplug", then it will get added once from the coldplug code, and then again from from the hotplug code path. We already have code checking for this, but the check is only compiled in under Windows -> Remove the #ifdef to also catch this under Linux. Signed-off-by: Hans de Goede --- gtk/usb-device-manager.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index 3f4c272..34ff37c 100644 --- a/gtk/usb-device-manager.c +++ b/gtk/usb-device-manager.c @@ -699,13 +699,11 @@ static void spice_usb_device_manager_add_dev(SpiceUsbDeviceManager *self, return; } -#ifdef G_OS_WIN32 device = spice_usb_device_manager_find_device(self, bus, address); if (device) { SPICE_DEBUG("USB device at %d.%d already exists, ignored", bus, address); return; } -#endif if (priv->coldplug_list) dev_list = priv->coldplug_list; -- cgit v1.2.3