Unlinking the monitor source after unlinking the sink leads to a crash when the monitor
source is master of a virtual source. Changing the unlink order fixes the problem.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/493>
j = i;
}
+ /* Unlink monitor source before unlinking the sink */
+ if (s->monitor_source)
+ pa_source_unlink(s->monitor_source);
+
if (linked)
/* It's important to keep the suspend cause unchanged when unlinking,
* because if we remove the SESSION suspend cause here, the alsa sink
reset_callbacks(s);
- if (s->monitor_source)
- pa_source_unlink(s->monitor_source);
-
if (linked) {
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK | PA_SUBSCRIPTION_EVENT_REMOVE, s->index);
pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SINK_UNLINK_POST], s);