mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
fix shutdown when --disallow-module-loading=1 is passed
This commit is contained in:
parent
ca127532fc
commit
34dd4a20f2
26 changed files with 62 additions and 58 deletions
|
|
@ -156,9 +156,6 @@ static void pa_module_free(pa_module *m) {
|
|||
pa_assert(m);
|
||||
pa_assert(m->core);
|
||||
|
||||
if (m->core->disallow_module_loading)
|
||||
return;
|
||||
|
||||
pa_log_info("Unloading \"%s\" (index: #%u).", m->name, m->index);
|
||||
|
||||
if (m->done)
|
||||
|
|
@ -175,22 +172,27 @@ static void pa_module_free(pa_module *m) {
|
|||
pa_xfree(m);
|
||||
}
|
||||
|
||||
void pa_module_unload(pa_core *c, pa_module *m) {
|
||||
void pa_module_unload(pa_core *c, pa_module *m, pa_bool_t force) {
|
||||
pa_assert(c);
|
||||
pa_assert(m);
|
||||
|
||||
pa_assert(c->modules);
|
||||
if (m->core->disallow_module_loading && !force)
|
||||
return;
|
||||
|
||||
if (!(m = pa_idxset_remove_by_data(c->modules, m, NULL)))
|
||||
return;
|
||||
|
||||
pa_module_free(m);
|
||||
}
|
||||
|
||||
void pa_module_unload_by_index(pa_core *c, uint32_t idx) {
|
||||
void pa_module_unload_by_index(pa_core *c, uint32_t idx, pa_bool_t force) {
|
||||
pa_module *m;
|
||||
pa_assert(c);
|
||||
pa_assert(idx != PA_IDXSET_INVALID);
|
||||
|
||||
if (m->core->disallow_module_loading && !force)
|
||||
return;
|
||||
|
||||
if (!(m = pa_idxset_remove_by_index(c->modules, idx)))
|
||||
return;
|
||||
|
||||
|
|
@ -198,7 +200,6 @@ void pa_module_unload_by_index(pa_core *c, uint32_t idx) {
|
|||
}
|
||||
|
||||
void pa_module_unload_all(pa_core *c) {
|
||||
|
||||
pa_assert(c);
|
||||
|
||||
if (c->modules) {
|
||||
|
|
@ -245,7 +246,7 @@ void pa_module_unload_unused(pa_core *c) {
|
|||
if (m->last_used_time + m->core->module_idle_time > now)
|
||||
continue;
|
||||
|
||||
pa_module_unload(c, m);
|
||||
pa_module_unload(c, m, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -262,12 +263,15 @@ static void defer_cb(pa_mainloop_api*api, pa_defer_event *e, void *userdata) {
|
|||
|
||||
while ((m = pa_idxset_iterate(c->modules, &state, NULL)))
|
||||
if (m->unload_requested)
|
||||
pa_module_unload(c, m);
|
||||
pa_module_unload(c, m, TRUE);
|
||||
}
|
||||
|
||||
void pa_module_unload_request(pa_module *m) {
|
||||
void pa_module_unload_request(pa_module *m, pa_bool_t force) {
|
||||
pa_assert(m);
|
||||
|
||||
if (m->core->disallow_module_loading && !force)
|
||||
return;
|
||||
|
||||
m->unload_requested = TRUE;
|
||||
|
||||
if (!m->core->module_defer_unload_event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue