[glib-networking] Unref GCancellables if they were reffed by the object.



commit 9360ee99c0f71c1293edb4645c8c0cd05a6ba55c
Author: Mike Ruprecht <mike ruprecht collabora co uk>
Date:   Fri Apr 1 16:40:18 2011 -0500

    Unref GCancellables if they were reffed by the object.

 tls/gnutls/gtlsinputstream-gnutls.c  |    3 +++
 tls/gnutls/gtlsoutputstream-gnutls.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/tls/gnutls/gtlsinputstream-gnutls.c b/tls/gnutls/gtlsinputstream-gnutls.c
index 0874576..dd22be5 100644
--- a/tls/gnutls/gtlsinputstream-gnutls.c
+++ b/tls/gnutls/gtlsinputstream-gnutls.c
@@ -93,6 +93,9 @@ g_tls_input_stream_gnutls_read_ready (GPollableInputStream *stream,
     }
   else
     g_simple_async_result_set_op_res_gssize (simple, nread);
+
+  if (tls_stream->priv->cancellable)
+    g_object_unref (tls_stream->priv->cancellable);
   g_simple_async_result_complete (simple);
   g_object_unref (simple);
 
diff --git a/tls/gnutls/gtlsoutputstream-gnutls.c b/tls/gnutls/gtlsoutputstream-gnutls.c
index e69e445..462d74e 100644
--- a/tls/gnutls/gtlsoutputstream-gnutls.c
+++ b/tls/gnutls/gtlsoutputstream-gnutls.c
@@ -93,6 +93,9 @@ g_tls_output_stream_gnutls_write_ready (GIOStreamAdapter *adapter,
     }
   else
     g_simple_async_result_set_op_res_gssize (simple, nwrote);
+
+  if (tls_stream->priv->cancellable)
+    g_object_unref (tls_stream->priv->cancellable);
   g_simple_async_result_complete (simple);
   g_object_unref (simple);
 



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