[Spice-devel] [spice-gtk] Remove channels from SpiceSession::channels on session disconnect

Christophe Fergeau cfergeau at redhat.com
Mon Nov 24 02:17:47 PST 2014


On Fri, Nov 21, 2014 at 02:13:20PM +0100, Marc-André Lureau wrote:
> Fundamentally, it doesn't change much from my patch, I guess removing
> g_clear_object(channel->priv->session) and ignoring the case where the
> channel isn't in the session (like you do here) would have been the
> same.

Yup, that's very likely, it was easier for me to restart from scratch (after
learning from your patches) than to try to modify your patches, but
they probably don't need to be much different indeed.

> 
> I still think it's a better idea to clear the channel->session if the
> channel has been disconnect from the session, although I agree that it
> requires a bit more testing and fixing for some warnings/criticals.

Well, clearing the session would indeed be cleaner, but it has its share
of issues with existing code. Ideally it would be possible not to set
the session to NULL for now, and warn when something tries to use the
session after it has been disconnected. This would allow to fix the
various issues that show up without risking a crash on a NULL session,
but I don't really see how to achieve that except by adding some
test+g_warning to all function acting on a session.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20141124/edd61672/attachment.sig>


More information about the Spice-devel mailing list