mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-17 08:56:42 -05:00
Don't store pointer to pa_module
pa_module pointers might become invalid at any time, so we use the stable uin32_t index of the module for identifying or modules instead.
This commit is contained in:
parent
c5b8eb7edf
commit
86c6fd85f1
1 changed files with 3 additions and 3 deletions
|
|
@ -44,7 +44,7 @@ PA_MODULE_USAGE("");
|
||||||
|
|
||||||
struct module {
|
struct module {
|
||||||
char *profile;
|
char *profile;
|
||||||
pa_module *pa_m;
|
uint32_t index;
|
||||||
PA_LLIST_FIELDS(struct module);
|
PA_LLIST_FIELDS(struct module);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ static struct module *module_new(const char *profile, pa_module *pa_m) {
|
||||||
|
|
||||||
m = pa_xnew(struct module, 1);
|
m = pa_xnew(struct module, 1);
|
||||||
m->profile = pa_xstrdup(profile);
|
m->profile = pa_xstrdup(profile);
|
||||||
m->pa_m = pa_m;
|
m->index = pa_m->index;
|
||||||
PA_LLIST_INIT(struct module, m);
|
PA_LLIST_INIT(struct module, m);
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
|
|
@ -364,7 +364,7 @@ static void unload_module_for_device(struct userdata *u, struct device *d, const
|
||||||
if (!(m = module_find(d, profile)))
|
if (!(m = module_find(d, profile)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pa_module_unload_request(m->pa_m, TRUE);
|
pa_module_unload_request_by_index(u->module->core, m->index, TRUE);
|
||||||
|
|
||||||
PA_LLIST_REMOVE(struct module, d->module_list, m);
|
PA_LLIST_REMOVE(struct module, d->module_list, m);
|
||||||
module_free(m);
|
module_free(m);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue