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

Re: [virt-tools-list] [PATCH virt-viewer 12/25] Prevent from adding the same display several time in the session



On Tue, Jul 17, 2012 at 09:24:54PM +0200, Marc-André Lureau wrote:
> In virt_viewer_session_spice_display_monitors(), we (re)add the
> display unconditionnaly every time we receive a new MonitorConfig.
> ---
>  src/virt-viewer-session.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c
> index 18b6922..9249a1f 100644
> --- a/src/virt-viewer-session.c
> +++ b/src/virt-viewer-session.c
> @@ -282,6 +282,9 @@ virt_viewer_session_new(void)
>  void virt_viewer_session_add_display(VirtViewerSession *session,
>                                       VirtViewerDisplay *display)
>  {
> +    if (g_list_find(session->priv->displays, display))
> +        return;
> +
>      session->priv->displays = g_list_append(session->priv->displays, display);
>      g_object_ref(display);
>      g_signal_emit_by_name(session, "session-display-added", display);

ACK


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 :|


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