tests: fix leak in mainloop test
authorRyan Lortie <desrt@desrt.ca>
Mon, 25 Mar 2013 01:55:08 +0000 (21:55 -0400)
committerStef Walter <stefw@gnome.org>
Wed, 6 Nov 2013 09:12:50 +0000 (10:12 +0100)
Properly unref a pair of GSources in the unix-fd mainloop test.

valgrind was reporting these as 'still reachable' before (possibly due
to some residual pointers somewhere in memory), but when running with
G_DEBUG=cleanup they were properly reported as leaked.

glib/tests/mainloop.c

index 2eaaa94..1acc3b4 100644 (file)
@@ -1273,7 +1273,9 @@ test_unix_fd_source (void)
   g_assert (in && out);
 
   g_source_destroy (out_source);
+  g_source_unref (out_source);
   g_source_destroy (in_source);
+  g_source_unref (in_source);
   close (fds[1]);
   close (fds[0]);
 }