[Spice-devel] [PATCHv2 18/22] session: remove sticky disconnecting flag
Marc-André Lureau
marcandre.lureau at redhat.com
Wed Nov 26 09:56:09 PST 2014
This used to help prevent double-unref when channel were considered part
of the session as long as they lived. Now it shouldn't be required
anymore
---
gtk/spice-session.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index a7f128a..8059f2f 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -1382,9 +1382,9 @@ gboolean spice_session_connect(SpiceSession *session)
g_return_val_if_fail(SPICE_IS_SESSION(session), FALSE);
s = session->priv;
+ g_return_val_if_fail(!s->disconnecting, FALSE);
spice_session_disconnect(session);
- s->disconnecting = FALSE;
s->client_provided_sockets = FALSE;
@@ -1417,9 +1417,9 @@ gboolean spice_session_open_fd(SpiceSession *session, int fd)
g_return_val_if_fail(fd >= -1, FALSE);
s = session->priv;
+ g_return_val_if_fail(!s->disconnecting, FALSE);
spice_session_disconnect(session);
- s->disconnecting = FALSE;
s->client_provided_sockets = TRUE;
@@ -1756,8 +1756,7 @@ void spice_session_disconnect(SpiceSession *session)
memset(s->uuid, 0, sizeof(s->uuid));
spice_session_abort_migration(session);
- /* we leave disconnecting = TRUE, so that spice_channel_disconnect()
- is not called multiple times */
+ s->disconnecting = FALSE;
}
/**
--
2.1.0
More information about the Spice-devel
mailing list