pulse-server: module: only cancel unload work if added

Only try to cancel the unload work in the work queue
if one has actually been added.
This commit is contained in:
Barnabás Pőcze 2022-01-20 02:41:49 +01:00
parent f4fd884b15
commit 186d0a783e

View file

@ -103,8 +103,10 @@ void module_free(struct module *module)
if (module->index != SPA_ID_INVALID)
pw_map_remove(&impl->modules, module->index & MODULE_INDEX_MASK);
if (module->unloading)
pw_work_queue_cancel(impl->work_queue, module, SPA_ID_INVALID);
spa_hook_list_clean(&module->listener_list);
pw_work_queue_cancel(impl->work_queue, module, SPA_ID_INVALID);
pw_properties_free(module->props);
free((char*)module->name);