pulse-server: module: do not schedule unloading multiple times

While it is not a problem since `module_free()` calls
`pw_work_queue_cancel()`, it is completely unnecessary
to do it more than once.

Introduce a new flag on the module which stores whether or
not an unloading has been scheduled.
This commit is contained in:
Barnabás Pőcze 2021-12-28 19:21:01 +01:00 committed by Wim Taymans
parent 4fbe3cbfc6
commit b08da23715
2 changed files with 6 additions and 2 deletions

View file

@ -66,6 +66,7 @@ struct module {
struct spa_hook_list listener_list;
void *user_data;
unsigned int loaded:1;
unsigned int unloading:1;
};
#define module_emit_loaded(m,r) spa_hook_list_call(&m->listener_list, struct module_events, loaded, 0, r)