[virt-tools-list] [PATCH virt-viewer] spice: calling VirtViewerSession:close() can destroy self

Christophe Fergeau cfergeau at redhat.com
Mon Dec 1 09:54:22 UTC 2014


On Tue, Nov 25, 2014 at 12:57:39PM +0100, Marc-André Lureau wrote:
> SpiceSession in spice-gtk v0.27 removes channels from session during
> disconnect (and not when they are actually disposed). When no channels
> are left, session-disconnected is emitted, and the VirtViewerSession
> will be unref from the application. Use a weak reference to self to
> avoid crashing after calling spice_session_disconnect()
> 
> As a workaround for existing clients, spice-gtk v0.27 will defer the
> disconnection to idle time.  But the fix still makes sense and would
> prevent potentially future issues if spice-gtk changes back to sync
> disconnection.
> 
> (the alternative of calling ref/unref would keep recreating session,
>  which is something it can avoid when leaving the application)

ACK, though I read the last sentence as implying there will be a loop of
some sort ("keep recreating"), I think what happens is something like
"the alternative of calling ref/unref would needlessly recreate a
SpiceSession with a call to create_spice_session(), which is something
we can avoid when leaving the application."

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20141201/5ef0e91c/attachment.sig>


More information about the virt-tools-list mailing list