mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2025-12-21 14:00:05 +01:00
tests: common: make sure no events are pending before destroying core
This commit is contained in:
parent
f9767d19a6
commit
85a7f01cb6
1 changed files with 8 additions and 0 deletions
|
|
@ -109,6 +109,8 @@ wp_base_test_fixture_teardown (WpBaseTestFixture * self)
|
||||||
wp_core_sync (self->client_core, NULL,
|
wp_core_sync (self->client_core, NULL,
|
||||||
(GAsyncReadyCallback) test_core_done_cb, self);
|
(GAsyncReadyCallback) test_core_done_cb, self);
|
||||||
g_main_loop_run (self->loop);
|
g_main_loop_run (self->loop);
|
||||||
|
g_signal_handlers_disconnect_by_data (self->client_core, self);
|
||||||
|
wp_core_disconnect (self->client_core);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* wait for all core pending tasks to be done */
|
/* wait for all core pending tasks to be done */
|
||||||
|
|
@ -116,8 +118,14 @@ wp_base_test_fixture_teardown (WpBaseTestFixture * self)
|
||||||
wp_core_sync (self->core, NULL, (GAsyncReadyCallback) test_core_done_cb,
|
wp_core_sync (self->core, NULL, (GAsyncReadyCallback) test_core_done_cb,
|
||||||
self);
|
self);
|
||||||
g_main_loop_run (self->loop);
|
g_main_loop_run (self->loop);
|
||||||
|
g_signal_handlers_disconnect_by_data (self->core, self);
|
||||||
|
wp_core_disconnect (self->core);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* double check and ensure that there is no event pending */
|
||||||
|
while (g_main_context_pending (self->context))
|
||||||
|
g_main_context_iteration (self->context, TRUE);
|
||||||
|
|
||||||
g_main_context_pop_thread_default (self->context);
|
g_main_context_pop_thread_default (self->context);
|
||||||
g_clear_object (&self->client_core);
|
g_clear_object (&self->client_core);
|
||||||
g_clear_object (&self->core);
|
g_clear_object (&self->core);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue