[Spice-devel] [PATCH spice-gtk 3/9] channel: reset channel state to unconnected

Marc-André Lureau marcandre.lureau at redhat.com
Mon Feb 16 09:02:24 PST 2015


After coroutine has exited, reset channel state to unconnected,
this allows recycling a channel for reconnection, even in "normal"
disconnect/reconnect cases.
---
 gtk/spice-channel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index 100f272..e3c4299 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2183,8 +2183,9 @@ static gboolean spice_channel_delayed_unref(gpointer data)
 
     g_return_val_if_fail(c->coroutine.coroutine.exited == TRUE, FALSE);
 
+    c->state = SPICE_CHANNEL_STATE_UNCONNECTED;
+
     if (c->event != SPICE_CHANNEL_NONE) {
-        c->state = SPICE_CHANNEL_STATE_UNCONNECTED;
         g_coroutine_signal_emit(channel, signals[SPICE_CHANNEL_EVENT], 0, c->event);
         c->event = SPICE_CHANNEL_NONE;
         g_clear_error(&c->error);
-- 
2.1.0



More information about the Spice-devel mailing list