Re: [spice-gtk 3/3] usb-device-manager: Fix USB event thread leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 30, 2016 at 01:49:57PM +0200, Hans de Goede wrote:
> Hi,
> Thinking about this more, the easiest fix is probably for
> channel-usbredir.c to take a ref on the usb_device_manager when it calls
> spice_usb_device_manager_start_event_listening(), and use that ref when
> it wants to call spice_usb_device_manager_stop_event_listening() and
> then g_clear_object its ref.

That's something I actually considered while looking at the issue, but
at the time I was not familiar with the code to be sure I would not
introduce cyclic references, and then I forgot. Now that you mention it,
this indeed should work (and I tested/sent patches doing that).

> Another potential issue I've noticed is the replacement of
> GSimpleAsyncResult with GTask, the code was relying on GSimpleAsyncResult
> taking a ref on the passed in gobject (the usbredir channel) and then
> releasing that after the callback has completed. I'm not sure if
> the GTask replacement code also does this, if not then we need to
> do this explicitly (in ALL places where we use GTask).

Yes, GTask takes a ref on its source object (first arg to g_task_new()).
This is what was causing problems in
https://cgit.freedesktop.org/spice/spice-gtk/commit/?id=183c84d07c62b6b0e9587208e5a8a0c808d72f32
I think. I also checked glib/gio/gtask.c to be 100% sure of this
statement.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]