[virt-tools-list] [PATCH virt-viewer 10/19] Use virt_viewer_connect_object() for display

Christophe Fergeau cfergeau at redhat.com
Tue Jul 17 12:45:27 UTC 2012


On Tue, Jul 17, 2012 at 01:11:50PM +0200, Marc-André Lureau wrote:
> On Tue, Jul 17, 2012 at 11:26 AM, Christophe Fergeau
> <cfergeau at redhat.com> wrote:
> > On Mon, Jul 16, 2012 at 06:57:45PM +0200, Marc-André Lureau wrote:
> >> When display is released, detach signal automatically
> >
> > Same question as the similar patch before, why? I'm assuming that it's
> > because we are going to handle displays dynamically, and if we don't do
> > that, we'll sometimes end up with signals using dead objects?
> 
> Yeah, I don't have a backtrace, but you can get into various crash
> related to not cleaning up signal handlers properly. 

Just add this to the commit log.

> In general, this
> signal_connect helper is really awesome, as you don't have to worry
> about either emitter or receiver being dead, but some time you may
> prefer to actually crash if something goes wrong. So a systematic
> replace isn't what I would recommend. But for Spice channel & display,
> it is needed to cleanup if either of the two is destroyed.

I agree using it makes sense, but it's useful for the review, or for future
bisections to know if it fixes a bug, or if it's in preparation for future
changes, ...
As far as I know, signal handlers will get cleaned up when the emitter goes
away, so the main advantage of this function is of being a working
g_signal_connect_object implementation which disconnects the signal handler
when user_data goes away.

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


More information about the virt-tools-list mailing list