Blob Blame History Raw
From 3895d4e7532bb853fb62ff1991449398dee899b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Thu, 9 Apr 2015 13:25:36 +0200
Subject: [PATCH] session-spice: Destroy the channel instead of emit a
 "session-disconnect" signal

Whenever we reach these branches, we will abort or have to create a new
spice session (from the dialog showed to the user). So, destroying the
channel on these situations seems sane enough.
It also avoids an error dialog to be popped out twice with (basically)
the same information.

(cherry picked from commit f3fe9ffe7bd56a62e3a78f5974620fb54151918a)
---
 src/virt-viewer-session-spice.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index d3d7edc..f7a8dc7 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -591,7 +591,7 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED
                 spice_session_connect(self->priv->session);
             }
         } else {
-            g_signal_emit_by_name(session, "session-disconnected", error ? error->message : NULL);
+            virt_viewer_session_spice_channel_destroy(NULL, channel, session);
         }
     }
 #else
@@ -602,7 +602,7 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED
     case SPICE_CHANNEL_ERROR_IO:
     case SPICE_CHANNEL_ERROR_LINK:
     case SPICE_CHANNEL_ERROR_TLS:
-        g_signal_emit_by_name(session, "session-disconnected", NULL);
+        virt_viewer_session_spice_channel_destroy(NULL, channel, session);
         break;
     default:
         g_warning("unhandled spice main channel event: %d", event);