Re: [virt-viewer 2/2] session: Don't hold VirtViewerDisplay refs on channel destroy

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

 



On Tue, Nov 19, 2013 at 04:19:25PM -0500, Marc-André Lureau wrote:
> 
> 
> ----- Original Message -----
> > VirtViewerSessionSpice creates a reference-holding VirtViewerDisplay
> > array and associates it with the display SpiceChannel with
> > g_object_set_data(channel, "virt-viewer-displays").
> > 
> > When virt_viewer_session_spice_channel_destroy() is called and the display
> > channel is being destroyed, we should ensure these VirtViewerDisplay
> > references are dropped or the displays could outlive the session.
> 
> Should't it unref when the channel is disposed?

The backtrace below triggers during spice_channel_display_dispose (frame
#31), we start disposing the display channel, the session gets destroyed,
but the VirtViewerDisplaySpice are still alive through that
SpiceChannel:virt-viewer-displays array. and then some VirtViewerDisplaySpice
code runs and tries to use the VirtViewerSession that was just disposed.
After spice_channel_display_dispose() finishes running, the gobject data
'virt-viewer-displays' will get freed, and the VirtViewerDisplay will be
disposed of (that is, if we did not crash when trying to use the session).

By setting virt-viewer-displays to NULL in this patch, we make sure the
VirtViewerDisplay are freed at the same time as the VirtViewerSessionSpice.
It makes to do it here as the 'virt-viewer-displays' data is associated
with the display channel in VirtViewerSessionSpice.

Christophe

Attachment: pgpETleqHqXiF.pgp
Description: PGP signature

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list

[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux