mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	bluetooth: Fix thread teardown code ordering
thread_mq.outq may contain some unprocessed messages, which should be dispatched before unreffing the sink and source. If the sink and source are unreffed before all messages to them have been dispatched, the unreffing won't free the sink and source, and that in turn will likely cause problems with things getting freed in a wrong order.
This commit is contained in:
		
							parent
							
								
									5d4b7c4a89
								
							
						
					
					
						commit
						77b3ba514c
					
				
					 1 changed files with 7 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -1954,6 +1954,13 @@ static void stop_thread(struct userdata *u) {
 | 
			
		|||
        u->rtpoll_item = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (u->rtpoll) {
 | 
			
		||||
        pa_thread_mq_done(&u->thread_mq);
 | 
			
		||||
 | 
			
		||||
        pa_rtpoll_free(u->rtpoll);
 | 
			
		||||
        u->rtpoll = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (u->transport) {
 | 
			
		||||
        bt_transport_release(u);
 | 
			
		||||
        u->transport = NULL;
 | 
			
		||||
| 
						 | 
				
			
			@ -1981,13 +1988,6 @@ static void stop_thread(struct userdata *u) {
 | 
			
		|||
        u->source = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (u->rtpoll) {
 | 
			
		||||
        pa_thread_mq_done(&u->thread_mq);
 | 
			
		||||
 | 
			
		||||
        pa_rtpoll_free(u->rtpoll);
 | 
			
		||||
        u->rtpoll = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (u->read_smoother) {
 | 
			
		||||
        pa_smoother_free(u->read_smoother);
 | 
			
		||||
        u->read_smoother = NULL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue