mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	sink: Unlink monitor source before unlinking sink
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>
This commit is contained in:
		
							parent
							
								
									597a1eb1ba
								
							
						
					
					
						commit
						12cf6da242
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -784,6 +784,10 @@ void pa_sink_unlink(pa_sink* s) {
 | 
			
		|||
        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
 | 
			
		||||
| 
						 | 
				
			
			@ -795,9 +799,6 @@ void pa_sink_unlink(pa_sink* s) {
 | 
			
		|||
 | 
			
		||||
    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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue