diff options
author | Colin Walters <walters@verbum.org> | 2013-11-03 17:06:22 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2013-11-03 18:11:38 -0500 |
commit | 45d84ff3a03f547819fa53731df5d7b2b72150d0 (patch) | |
tree | cc86e3f65355284d73b549208fece18f5463e7e5 | |
parent | 819298693dba366cde307adcdc541c8d6039403d (diff) | |
download | libsoup-45d84ff3a03f547819fa53731df5d7b2b72150d0.tar.gz |
tests/connection-test: Ensure quit source id is reset to 0 between runs
Otherwise we may attempt to remove a nonexistent quit loop from the
previous one. The second hunk here is the real fix, the first is just
being more defensive/consistent.
Reported-By: Kjartan Maraas <kmaraas@gnome.org>
Tested-By: Kjartan Maraas <kmaraas@gnome.org>
https://bugzilla.gnome.org/show_bug.cgi?id=711361
-rw-r--r-- | tests/connection-test.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/connection-test.c b/tests/connection-test.c index 3d517539..fd7179f2 100644 --- a/tests/connection-test.c +++ b/tests/connection-test.c @@ -495,6 +495,8 @@ do_max_conns_test_for_session (SoupSession *session) msgs_done = 0; g_idle_add (idle_start_server, NULL); + if (quit_loop_timeout) + g_source_remove (quit_loop_timeout); quit_loop_timeout = g_timeout_add (1000, quit_loop, NULL); g_main_loop_run (max_conns_loop); @@ -517,8 +519,10 @@ do_max_conns_test_for_session (SoupSession *session) } g_main_loop_unref (max_conns_loop); - if (quit_loop_timeout) + if (quit_loop_timeout) { g_source_remove (quit_loop_timeout); + quit_loop_timeout = 0; + } for (i = 0; i < TEST_CONNS; i++) g_object_unref (msgs[i]); |