mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	gst: stream: Destroy stream before clearing variable
`pw_stream_destroy()` chains up to `on_remove_buffer()` in
GstPipeWireSrc which again needs the stream to still be around to call
`pw_stream_queue_buffer()` on it. By using `g_clear_pointer()` it will
already have been cleared, causing crashes.
Revert to the behavior from before the commit mentioned below and add a
comment in order to avoid regressing in a future cleanup.
Fixes: 0c40c0147 (gst: factor out the stream management and some common variables in a new class)
			
			
This commit is contained in:
		
							parent
							
								
									d08df293a9
								
							
						
					
					
						commit
						2fcb90f661
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -158,7 +158,12 @@ gst_pipewire_stream_close (GstPipeWireStream * self)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* destroy the pw stream */
 | 
					  /* destroy the pw stream */
 | 
				
			||||||
  pw_thread_loop_lock (self->core->loop);
 | 
					  pw_thread_loop_lock (self->core->loop);
 | 
				
			||||||
  g_clear_pointer (&self->pwstream, pw_stream_destroy);
 | 
					  if (self->pwstream) {
 | 
				
			||||||
 | 
					     /* Do not use g_clear_pointer() here as pw_stream_destroy() may chain up to
 | 
				
			||||||
 | 
					      * code requiring the pointer to still be around */
 | 
				
			||||||
 | 
					     pw_stream_destroy (self->pwstream);
 | 
				
			||||||
 | 
					     self->pwstream = NULL;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  pw_thread_loop_unlock (self->core->loop);
 | 
					  pw_thread_loop_unlock (self->core->loop);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* release the core */
 | 
					  /* release the core */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue