diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-01-21 14:26:41 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-01-21 19:04:51 +0100 |
commit | 2d8fc15ecf423cd629e5d3796791f144d4c49118 (patch) | |
tree | db282305e0dc9ccd8e486684cc2380f24f87a3c4 | |
parent | 174920271855d4399e70e4f662bc4578ba766123 (diff) |
gtk: use a session state on disconnection, be reentrant
-rw-r--r-- | gtk/spice-session.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk/spice-session.c b/gtk/spice-session.c index 666348a..a8d6c63 100644 --- a/gtk/spice-session.c +++ b/gtk/spice-session.c @@ -45,6 +45,7 @@ struct spice_session { guint32 mm_time; gboolean client_provided_sockets; guint64 mm_time_at_clock; + gboolean disconnecting; }; /** @@ -558,10 +559,11 @@ void spice_session_disconnect(SpiceSession *session) g_return_if_fail(s != NULL); - if (s->cmain == NULL) { + SPICE_DEBUG("session: disconnecting %d", s->disconnecting); + if (s->disconnecting) return; - } + s->disconnecting = TRUE; s->cmain = NULL; for (ring = ring_get_head(&s->channels); ring != NULL; ring = next) { @@ -571,6 +573,7 @@ void spice_session_disconnect(SpiceSession *session) } s->connection_id = 0; + s->disconnecting = FALSE; } /** @@ -713,6 +716,8 @@ void spice_session_channel_destroy(SpiceSession *session, SpiceChannel *channel) return; } } + + g_warn_if_reached(); } G_GNUC_INTERNAL |