[telepathy-glib/master] tests/dbus/call-cancellation: don't leak the proxy 'k'

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Dec 3 08:00:35 PST 2009


Also, explicitly clear all the pointers so valgrind can give us better
diagnostics about reachability.
---
 tests/dbus/call-cancellation.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tests/dbus/call-cancellation.c b/tests/dbus/call-cancellation.c
index 94dc111..5aeedcb 100644
--- a/tests/dbus/call-cancellation.c
+++ b/tests/dbus/call-cancellation.c
@@ -438,16 +438,25 @@ main (int argc,
 
   g_message ("Dereferencing remaining proxies");
   g_object_unref (a);
+  a = NULL;
   g_object_unref (b);
+  b = NULL;
   g_object_unref (c);
+  c = NULL;
   MYASSERT (d == NULL, "");
   g_object_unref (e);
+  e = NULL;
   g_object_unref (f);
+  f = NULL;
   MYASSERT (g == NULL, "");
   MYASSERT (h == NULL, "");
   MYASSERT (i == NULL, "");
   g_object_unref (j);
+  j = NULL;
+  g_object_unref (k);
+  k = NULL;
   g_object_unref (z);
+  z = NULL;
 
   /* we should already have checked each of these at least once, but just to
    * make sure we have a systematic test that all user data is freed... */
-- 
1.5.6.5




More information about the telepathy-commits mailing list