mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-08 10:06:23 -05:00
pulse-server: handle if the module is destroyed while loading
Create a new event for modules ('destroy') which is emitted from
`module_free()`. It is used by the module loading logic, to handle
when a module is destroyed without properly loading first.
This commit is contained in:
parent
bd5a715200
commit
0e75b3fa0f
3 changed files with 10 additions and 0 deletions
|
|
@ -4666,6 +4666,11 @@ static void on_module_loaded(void *data, int result)
|
|||
free(pm);
|
||||
}
|
||||
|
||||
static void on_module_destroy(void *data)
|
||||
{
|
||||
on_module_loaded(data, -ECANCELED);
|
||||
}
|
||||
|
||||
static void on_client_disconnect(void *data)
|
||||
{
|
||||
struct pending_module *pm = data;
|
||||
|
|
@ -4679,6 +4684,7 @@ static int do_load_module(struct client *client, uint32_t command, uint32_t tag,
|
|||
static const struct module_events module_events = {
|
||||
VERSION_MODULE_EVENTS,
|
||||
.loaded = on_module_loaded,
|
||||
.destroy = on_module_destroy,
|
||||
};
|
||||
static const struct client_events client_events = {
|
||||
VERSION_CLIENT_EVENTS,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue