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

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

 



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@xxxxxxxxx>
---
 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

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]