mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 21:17:45 +00:00
audio: pipewire: Reset all hotplug values and pointers on shutdown
Ensure that all hotplug variables and pointers are reset to NULL or their original value when shutting down.
This commit is contained in:
@@ -744,20 +744,27 @@ hotplug_loop_destroy()
|
|||||||
hotplug_init_complete = SDL_FALSE;
|
hotplug_init_complete = SDL_FALSE;
|
||||||
hotplug_events_enabled = SDL_FALSE;
|
hotplug_events_enabled = SDL_FALSE;
|
||||||
|
|
||||||
|
pipewire_default_sink_id = SPA_ID_INVALID;
|
||||||
|
pipewire_default_source_id = SPA_ID_INVALID;
|
||||||
|
|
||||||
if (hotplug_registry) {
|
if (hotplug_registry) {
|
||||||
PIPEWIRE_pw_proxy_destroy((struct pw_proxy *)hotplug_registry);
|
PIPEWIRE_pw_proxy_destroy((struct pw_proxy *)hotplug_registry);
|
||||||
|
hotplug_registry = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hotplug_core) {
|
if (hotplug_core) {
|
||||||
PIPEWIRE_pw_core_disconnect(hotplug_core);
|
PIPEWIRE_pw_core_disconnect(hotplug_core);
|
||||||
|
hotplug_core = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hotplug_context) {
|
if (hotplug_context) {
|
||||||
PIPEWIRE_pw_context_destroy(hotplug_context);
|
PIPEWIRE_pw_context_destroy(hotplug_context);
|
||||||
|
hotplug_context = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hotplug_loop) {
|
if (hotplug_loop) {
|
||||||
PIPEWIRE_pw_thread_loop_destroy(hotplug_loop);
|
PIPEWIRE_pw_thread_loop_destroy(hotplug_loop);
|
||||||
|
hotplug_loop = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user