/** * @brief Signal a USB device has been removed. * * This can be called from either the libusb thread or the main thread. However * only one of those will be active at once, so we can avoid locking. */ void AsyncPluginImpl::USBDeviceRemoved(libusb_device *usb_device) { WidgetFactory *factory = STLLookupAndRemovePtr( &m_device_factory_map, usb_device); if (factory) { factory->DeviceRemoved(&m_widget_observer, usb_device); } }