[Spice-devel] [spice-gtk v2 2/3] win-usb-dev: let _finalize() do libusb_exit()

Christophe Fergeau cfergeau at redhat.com
Tue Nov 15 16:21:11 UTC 2016


On Tue, Nov 15, 2016 at 02:33:15PM +0100, Victor Toso wrote:
> From: Victor Toso <me at victortoso.com>
> 
> This fixes a hang in mingw-spice-gtk when the GUdevClient fails to
> initialize due to problems in the UsbDk installation.
> 
> Before this patch, libusb_exit() was being called twice:
> - At g_udev_client_initable_init(), after failure with priv->ctx as
>   argument
> - At g_udev_client_finalize() as g_udev_client_initable_init() failure
>   implies the object failed to initialize and it is terminated. Here
>   it was being called with NULL as priv->ctx was set to NULL in
>   g_udev_client_initable_init()

Much improved log, thanks! 
Acked-by: Christophe Fergeau <cfergeau at redhat.com>

> 
> Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=98686
> Signed-off-by: Victor Toso <victortoso at redhat.com>
> Acked-by: Christophe Fergeau <cfergeau at redhat.com>
> ---
>  src/win-usb-dev.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c
> index 4b95b2d..5e5bb4d 100644
> --- a/src/win-usb-dev.c
> +++ b/src/win-usb-dev.c
> @@ -232,9 +232,6 @@ g_udev_client_initable_init(GInitable *initable, GCancellable *cancellable,
>   g_udev_client_init_failed_unreg:
>      UnregisterClass(G_UDEV_CLIENT_WINCLASS_NAME, NULL);
>   g_udev_client_init_failed:
> -    libusb_exit(priv->ctx);
> -    priv->ctx = NULL;
> -
>      return FALSE;
>  }
>  
> -- 
> 2.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20161115/a415e0e3/attachment.sig>


More information about the Spice-devel mailing list