[grilo] grl-net: Correctly unref operation async result



commit 5f401e69f613554fb3e3100ae46a14031742d1ca
Author: Sam Thursfield <sam thursfield codethink co uk>
Date:   Wed Oct 26 13:57:11 2011 +0100

    grl-net: Correctly unref operation async result
    
    Correct behaviour is to unref the GSimpleAsyncResult object after the call to
    g_simple_async_result_complete(). It cannot be done in the async result's callback.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=662763

 libs/net/grl-net-wc.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libs/net/grl-net-wc.c b/libs/net/grl-net-wc.c
index 58a6a95..fb0fd24 100644
--- a/libs/net/grl-net-wc.c
+++ b/libs/net/grl-net-wc.c
@@ -397,6 +397,7 @@ read_async_cb (GObject *source, GAsyncResult *res, gpointer user_data)
     g_error_free (error);
 
     g_simple_async_result_complete (result);
+    g_object_unref (result);
     return;
   }
 
@@ -413,6 +414,7 @@ read_async_cb (GObject *source, GAsyncResult *res, gpointer user_data)
   }
 
   g_simple_async_result_complete (result);
+  g_object_unref (result);
 }
 
 static void
@@ -431,6 +433,7 @@ reply_cb (GObject *source, GAsyncResult *res, gpointer user_data)
     g_error_free (error);
 
     g_simple_async_result_complete (result);
+    g_object_unref (result);
     return;
   }
 
@@ -471,6 +474,7 @@ reply_cb (SoupSession *session,
   }
 
   g_simple_async_result_complete (result);
+  g_object_unref (result);
 }
 
 static void
@@ -521,6 +525,7 @@ get_url_now (GrlNetWc *self,
                                      GRL_NET_WC_ERROR_PROTOCOL_ERROR,
                                      "Malformed URL: %s", url);
     g_simple_async_result_complete_in_idle (G_SIMPLE_ASYNC_RESULT (result));
+    g_object_unref (result);
 
     return;
   }
@@ -761,7 +766,6 @@ end_func:
   g_slice_free (RequestResult, rr);
 #endif
 
-  g_object_unref (res);
   return ret;
 }
 



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