summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2017-08-18 10:07:27 +0300
committerTanu Kaskinen <tanuk@iki.fi>2017-09-05 13:46:27 +0300
commit95404ce3f398a6882a73c09264a44cc8a9e394ec (patch)
tree7584146c63c8e0853d8e89601b8b98d31fec783a
parent5f27c2ec2fb0477f213e6794113182eaee1c43ba (diff)
cli-command: unload modules synchronously
Users may want to change the parameters of some load-once modules in ~/.config/pulse/default.pa. That should be possible by including /etc/pulse/default.pa from the per-user configuration file, and then unloading a module and reloading it with different parameters. However, that doesn't work, because the unload-module command will not unload the module immediately, so the subsequent load-module command will fail when the module can be loaded only once. This patch makes the module unloading synchronous. "pacmd unload-module module-cli-protocol-unix" is something that might not like this change, since the command will unload the code that is processing the command, but I tested it and it works fine. When pa_module_unload() is called, that won't yet remove the module code from memory, the lt_dlclose() call is postponed until it's safe to remove the code from memory. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102205
-rw-r--r--src/pulsecore/cli-command.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index 01fea475b..0d56ba94c 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -462,13 +462,13 @@ static int pa_cli_command_unload(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bo
return -1;
}
- pa_module_unload_request(m, false);
+ pa_module_unload(m, false);
} else {
PA_IDXSET_FOREACH(m, c->modules, idx)
if (pa_streq(i, m->name)) {
unloaded = true;
- pa_module_unload_request(m, false);
+ pa_module_unload(m, false);
}
if (unloaded == false) {