[Spice-devel] [PATCH spice-gtk 2/7] channel: check if channel has a session

Marc-André Lureau marcandre.lureau at gmail.com
Fri May 20 15:16:38 UTC 2016


Since 8943d2329, the channel may be disconnected from the session
before it's destroyed. In this case, session is NULL.

Fixes some critical with virt-manager when closing a display:

(virt-manager:20451): GSpice-CRITICAL **: spice_session_is_for_migration: assertion 'SPICE_IS_SESSION(session)' failed

Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
---
 src/spice-channel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/spice-channel.c b/src/spice-channel.c
index 35a2cae..c555f75 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -2307,7 +2307,7 @@ static gboolean spice_channel_delayed_unref(gpointer data)
     c->state = SPICE_CHANNEL_STATE_UNCONNECTED;
 
     session = spice_channel_get_session(channel);
-    if (spice_session_is_for_migration(session)) {
+    if (session && spice_session_is_for_migration(session)) {
         /* error during migration - abort migration */
         spice_session_abort_migration(session);
         return FALSE;
-- 
2.7.4



More information about the Spice-devel mailing list