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

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

 



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

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://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]