module-rt: first destroy the loop and then rtkit

Or else we might still try to use the rtkit in the thread.

See #3357
This commit is contained in:
Wim Taymans 2023-07-20 16:17:14 +02:00
parent 163fde0a69
commit 8d1b3f6f48

View file

@ -491,10 +491,10 @@ static void module_destroy(void *data)
spa_hook_remove(&impl->module_listener);
#ifdef HAVE_DBUS
if (impl->rtkit_bus)
pw_rtkit_bus_free(impl->rtkit_bus);
if (impl->thread_loop)
pw_thread_loop_destroy(impl->thread_loop);
if (impl->rtkit_bus)
pw_rtkit_bus_free(impl->rtkit_bus);
#endif
free(impl);
@ -1114,10 +1114,10 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
error:
#ifdef HAVE_DBUS
if (impl->rtkit_bus)
pw_rtkit_bus_free(impl->rtkit_bus);
if (impl->thread_loop)
pw_thread_loop_destroy(impl->thread_loop);
if (impl->rtkit_bus)
pw_rtkit_bus_free(impl->rtkit_bus);
#endif
free(impl);
done: