summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2011-11-05 12:25:44 +0100
committerOlivier CrĂȘte <olivier.crete@collabora.com>2011-11-07 12:48:26 -0500
commit01095d35333456a73b0ab34dc5d58348c1703d25 (patch)
tree359b04aa58b09dea3ba238e9db985baacd7f251a /tests
parent64c732881c7db22da4ebe850099fac7525b74e5b (diff)
downloadgupnp-igd-01095d35333456a73b0ab34dc5d58348c1703d25.tar.gz
Delay quitting of main loop through idle
Prevents the leaking of GUPnP*Igd when running multiple test-cases which causes spurious warnings about "Connection terminated unexpectedly".
Diffstat (limited to 'tests')
-rw-r--r--tests/gtest/gupnp-simple-igd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/gtest/gupnp-simple-igd.c b/tests/gtest/gupnp-simple-igd.c
index 3502d2c..e3cc154 100644
--- a/tests/gtest/gupnp-simple-igd.c
+++ b/tests/gtest/gupnp-simple-igd.c
@@ -140,6 +140,12 @@ add_port_mapping_cb (GUPnPService *service,
gupnp_service_action_return (action);
}
+static gboolean
+loop_quit (gpointer user_data) {
+ g_main_loop_quit (loop);
+
+ return FALSE;
+}
static void
delete_port_mapping_cb (GUPnPService *service,
@@ -169,7 +175,9 @@ delete_port_mapping_cb (GUPnPService *service,
g_free (remote_host);
g_free (proto);
- g_main_loop_quit (loop);
+ GSource* src = g_idle_source_new ();
+ g_source_set_callback (src, loop_quit, NULL, NULL);
+ g_source_attach (src, g_main_context_get_thread_default ());
}
static void