[virt-tools-list] [PATCH virt-viewer 03/25] spice: disconnect signal handlers when either object is destroyed
Daniel P. Berrange
berrange at redhat.com
Mon Jul 23 13:58:11 UTC 2012
On Tue, Jul 17, 2012 at 09:24:45PM +0200, Marc-André Lureau wrote:
> Use virt_viewer_signal_connect_object(), a copy of telepathy
> utility function tp_g_signal_connect_object(). This function
> will take care of removing signal handler if any of emitter or
> attached object are destroyed.
>
> The following patches will have this condition met, since there is no
> longer 1-1 relation between channel and display. The channels can
> continue to be around when some of the display are removed.
> ---
> src/virt-viewer-display-spice.c | 26 ++++-----
> src/virt-viewer-util.c | 117 +++++++++++++++++++++++++++++++++++++++
> src/virt-viewer-util.h | 6 ++
> 3 files changed, 135 insertions(+), 14 deletions(-)
> diff --git a/src/virt-viewer-util.h b/src/virt-viewer-util.h
> index 3a40651..38c8078 100644
> --- a/src/virt-viewer-util.h
> +++ b/src/virt-viewer-util.h
> @@ -40,6 +40,12 @@ int virt_viewer_util_extract_host(const char *uristr,
> char **user,
> int *port);
>
> +gulong virt_viewer_signal_connect_object(gpointer instance,
> + const gchar *detailed_signal,
> + GCallback c_handler,
> + gpointer gobject,
> + GConnectFlags connect_flags);
> +
> #endif
Superficially this looks like it tries todo the same as
g_signal_connect_object ?
http://developer.gnome.org/gobject/stable/gobject-Signals.html#g-signal-connect-object
Does it avoids the flaws mentioned about that API ?
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the virt-tools-list
mailing list