diff options
author | Dan Winship <danw@gnome.org> | 2012-10-31 11:08:06 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2012-10-31 11:09:42 -0400 |
commit | 04a0a7c674fcc8adc28da84eba1b79c4d9acb246 (patch) | |
tree | 0e9836460fa7d4e35ea93f2f274998264d11dd52 /tests/misc-test.c | |
parent | c4ff1663520f2167d274ac04cad7a88e9ba5902c (diff) | |
download | libsoup-04a0a7c674fcc8adc28da84eba1b79c4d9acb246.tar.gz |
tests: fix some race conditions
A few tests were written such that they could fail/crash if the machine
was too slow. Fix.
Diffstat (limited to 'tests/misc-test.c')
-rw-r--r-- | tests/misc-test.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/misc-test.c b/tests/misc-test.c index a71d4aae..19e9ba09 100644 --- a/tests/misc-test.c +++ b/tests/misc-test.c @@ -928,6 +928,7 @@ cancel_request_thread (gpointer cancellable) { g_usleep (100000); /* .1s */ g_cancellable_cancel (cancellable); + g_object_unref (cancellable); return NULL; } @@ -951,7 +952,7 @@ do_cancel_while_reading_req_test_for_session (SoupRequester *requester) } else { GThread *thread; - thread = g_thread_new ("cancel_request_thread", cancel_request_thread, cancellable); + thread = g_thread_new ("cancel_request_thread", cancel_request_thread, g_object_ref (cancellable)); soup_test_request_send (req, cancellable, &error); g_thread_unref (thread); } |