<div dir="ltr">this patch isn't working, I am fixing it<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 9, 2014 at 10:00 PM, Marc-André Lureau <span dir="ltr"><<a href="mailto:marcandre.lureau@redhat.com" target="_blank">marcandre.lureau@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This function is somewhat useless, and dangerous since it is<br>
calling g_object_unref() on your back (although this is mention in the<br>
doc, I consider this a bad practice).<br>
---<br>
 gtk/spice-channel.c | 3 ++-<br>
 gtk/spice-channel.h | 3 ++-<br>
 gtk/spice-session.c | 8 ++++----<br>
 3 files changed, 8 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c<br>
index 3dd8be3..99850e3 100644<br>
--- a/gtk/spice-channel.c<br>
+++ b/gtk/spice-channel.c<br>
@@ -2038,8 +2038,9 @@ SpiceChannel *spice_channel_new(SpiceSession *s, int type, int id)<br>
  * spice_channel_destroy:<br>
  * @channel:<br>
  *<br>
- * Disconnect and unref the @channel. Called by @spice_session_channel_destroy()<br>
+ * Disconnect and unref the @channel.<br>
  *<br>
+ * Deprecated: 0.27: this function has been removed<br>
  **/<br>
 void spice_channel_destroy(SpiceChannel *channel)<br>
 {<br>
diff --git a/gtk/spice-channel.h b/gtk/spice-channel.h<br>
index 1c303b4..8d07383 100644<br>
--- a/gtk/spice-channel.h<br>
+++ b/gtk/spice-channel.h<br>
@@ -107,7 +107,6 @@ GType spice_channel_get_type(void);<br>
 typedef void (*spice_msg_handler)(SpiceChannel *channel, SpiceMsgIn *in);<br>
<br>
 SpiceChannel *spice_channel_new(SpiceSession *s, int type, int id);<br>
-void spice_channel_destroy(SpiceChannel *channel);<br>
 gboolean spice_channel_connect(SpiceChannel *channel);<br>
 gboolean spice_channel_open_fd(SpiceChannel *channel, int fd);<br>
 void spice_channel_disconnect(SpiceChannel *channel, SpiceChannelEvent reason);<br>
@@ -118,6 +117,8 @@ gboolean spice_channel_flush_finish(SpiceChannel *channel, GAsyncResult *result,<br>
 #ifndef SPICE_DISABLE_DEPRECATED<br>
 SPICE_DEPRECATED<br>
 void spice_channel_set_capability(SpiceChannel *channel, guint32 cap);<br>
+SPICE_DEPRECATED<br>
+void spice_channel_destroy(SpiceChannel *channel);<br>
 #endif<br>
<br>
 const gchar* spice_channel_type_to_string(gint type);<br>
diff --git a/gtk/spice-session.c b/gtk/spice-session.c<br>
index 32da7c2..493c0ab 100644<br>
--- a/gtk/spice-session.c<br>
+++ b/gtk/spice-session.c<br>
@@ -1664,9 +1664,8 @@ void spice_session_disconnect(SpiceSession *session)<br>
     memset(s->uuid, 0, sizeof(s->uuid));<br>
<br>
     spice_session_abort_migration(session);<br>
-    /* we leave disconnecting = TRUE, so that spice_channel_destroy()<br>
-       is not called multiple times on channels that are in pending<br>
-       destroy state. */<br>
+    /* we leave disconnecting = TRUE, so that spice_channel_disconnect()<br>
+       is not called multiple times */<br>
 }<br>
<br>
 /**<br>
@@ -1971,7 +1970,8 @@ static void spice_session_channel_destroy(SpiceSession *session, SpiceChannel *c<br>
     g_signal_emit(session, signals[SPICE_SESSION_CHANNEL_DESTROY], 0, channel);<br>
<br>
     g_clear_object(&channel->priv->session);<br>
-    spice_channel_destroy(channel);<br>
+    spice_channel_disconnect(channel);<br>
+    g_object_unref(channel);<br>
 }<br>
<br>
 G_GNUC_INTERNAL<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.3<br>
<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Marc-André Lureau</div>
</div>