gio/tests: fix leaks

https://bugzilla.gnome.org/show_bug.cgi?id=682560
This commit is contained in:
Dan Winship
2012-08-24 20:43:54 -04:00
parent 17bb9d542c
commit beb0f9c150
11 changed files with 94 additions and 16 deletions

View File

@@ -119,6 +119,9 @@ test1_thread (gpointer user_data)
g_cond_signal (&test1_cond);
g_mutex_unlock (&test1_mutex);
g_main_context_pop_thread_default (context);
g_main_context_unref (context);
return NULL;
}
@@ -164,6 +167,9 @@ test_context_independence (void)
g_source_remove (default_timeout);
g_source_destroy (thread_default_timeout);
g_source_unref (thread_default_timeout);
g_main_context_pop_thread_default (context);
g_main_context_unref (context);
}
static gboolean
@@ -177,6 +183,7 @@ int
main (int argc, char **argv)
{
GError *error = NULL;
int ret;
g_type_init ();
g_test_init (&argc, &argv, NULL);
@@ -188,5 +195,9 @@ main (int argc, char **argv)
g_test_add_func ("/gio/contexts/thread-independence", test_thread_independence);
g_test_add_func ("/gio/contexts/context-independence", test_context_independence);
return g_test_run();
ret = g_test_run();
g_free (test_file_buffer);
return ret;
}