On Thu, 2015-10-29 at 17:26 +0200, Dmitry Fleytman wrote:Signed-off-by: Dmitry Fleytman <dmitry@xxxxxxxxxx> --- src/usb-device-manager.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c index 53820b4..f4e48eb 100644 --- a/src/usb-device-manager.c +++ b/src/usb-device-manager.c @@ -231,7 +231,8 @@ static void spice_usb_device_manager_init(SpiceUsbDeviceManager *self) self->priv = priv;
#if defined(G_OS_WIN32) && defined(USE_USBREDIR) - priv->use_usbclerk = TRUE; + priv->use_usbclerk = !usbdk_is_driver_installed() || + !usbdk_api_load(&priv->usbdk_api);
as I just mentioned in another mail, the api needs to be loaded before it isused. So this patch will need to be re-ordered.
See my explanation in reply on your comments for previous patches. This is by design to make history more clear. #endif priv->channels = g_ptr_array_new(); #ifdef USE_USBREDIR @@ -381,6 +382,8 @@ static void spice_usb_device_manager_finalize(GObject *gobject) if (!priv->use_usbclerk) { if(priv->auto_connect) _usbdk_autoredir_disable(self); + + usbdk_api_unload(priv->usbdk_api);
Since loading the API can fail, i think it would be better to check if priv->usbdk_api is non-NULL before unloading it.
I fixed this in usbdk_api_unload(). Thanks.
|
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel