pulse-server: module: initialize index

Initialize the index to `SPA_ID_INVALID` when a
module object is created. This way `module_free()`
may be called right after `module_new()`.
This commit is contained in:
Barnabás Pőcze 2022-01-19 12:06:10 +01:00
parent abe87f8008
commit d71dd31dcf

View file

@ -67,6 +67,7 @@ struct module *module_new(struct impl *impl, const struct module_methods *method
if (module == NULL) if (module == NULL)
return NULL; return NULL;
module->index = SPA_ID_INVALID;
module->impl = impl; module->impl = impl;
module->methods = methods; module->methods = methods;
spa_hook_list_init(&module->listener_list); spa_hook_list_init(&module->listener_list);