Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
gobject/tests: plug leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
danwinship committed Sep 3, 2012
1 parent e0cba35 commit 03be681
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions gobject/tests/signals.c
Expand Up @@ -762,6 +762,9 @@ test_all_types (void)
g_assert_cmpint (all_type_handlers_count, ==, 3 + 5 + 5);

g_object_unref (test);
g_param_spec_unref (param);
g_bytes_unref (bytes);
g_variant_unref (var);
}

static void
Expand Down
13 changes: 10 additions & 3 deletions gobject/tests/threadtests.c
Expand Up @@ -114,12 +114,19 @@ tester_init_thread (gpointer data)
static void
test_threaded_class_init (void)
{
GThread *thread;

/* pause newly created threads */
g_mutex_lock (&sync_mutex);

/* create threads */
g_thread_create (tester_init_thread, (gpointer) my_tester0_get_type(), TRUE, NULL);
g_thread_create (tester_init_thread, (gpointer) my_tester1_get_type(), TRUE, NULL);
g_thread_create (tester_init_thread, (gpointer) my_tester2_get_type(), TRUE, NULL);
thread = g_thread_create (tester_init_thread, (gpointer) my_tester0_get_type(), TRUE, NULL);
g_thread_unref (thread);
thread = g_thread_create (tester_init_thread, (gpointer) my_tester1_get_type(), TRUE, NULL);
g_thread_unref (thread);
thread = g_thread_create (tester_init_thread, (gpointer) my_tester2_get_type(), TRUE, NULL);
g_thread_unref (thread);

/* execute threads */
g_mutex_unlock (&sync_mutex);
while (g_atomic_int_get (&mtsafe_call_counter) < (3 + 3 + 3 * 3) * NUM_COUNTER_INCREMENTS)
Expand Down

0 comments on commit 03be681

Please sign in to comment.