module: Fix unsafe iteration

This fixes an issue when requesting module unload for
module-bluetooth-discover. When unloading the module, it also unloads
module-bluez4-discover and/or module-bluez5-discover, and that
invalidated the state variable that was used for iterating through the
modules idxset.

The pa_module.unload_requested flag could now otherwise be removed,
but it's still being (ab)used in the bluetooth modules.
This commit is contained in:
Tanu Kaskinen 2014-12-05 15:51:35 +02:00
parent 686baf80d9
commit 2b6632e851
3 changed files with 11 additions and 5 deletions

View file

@ -164,6 +164,7 @@ struct pa_core {
int deferred_volume_extra_delay_usec;
pa_defer_event *module_defer_unload_event;
pa_hashmap *modules_pending_unload; /* pa_module -> pa_module (hashmap-as-a-set) */
pa_defer_event *subscription_defer_event;
PA_LLIST_HEAD(pa_subscription, subscriptions);