mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	gst: deviceprovider: take a ref to devices
When _probe() is called, take a ref to the newly created devices instead if sinking the floating ref, since gst_clear_object() is called when core is disconnected. Otherwise the devices will be freed before the caller gets them. Fixes the following assert in the caller: g_object_is_floating: assertion 'G_IS_OBJECT (object)' failed Or sometimes a segfault with the backtrace: 0 g_type_check_instance_is_fundamentally_a (type_instance=type_instance@entry=0x116c1b0, fundamental_type=fundamental_type@entry=80) at /usr/src/debug/glib-2.0/2.84.0/gobject/gtype.c:3918 1 0xb6d40cc6 in g_object_is_floating (_object=0x116c1b0) at /usr/src/debug/glib-2.0/2.84.0/gobject/gobject.c:3843 2 0xb6bc4c74 in gst_device_provider_get_devices (provider=0x109ba00) at /usr/src/debug/gstreamer1.0/1.24.12/gst/gstdeviceprovider.c:426
This commit is contained in:
		
							parent
							
								
									b51d3d7e8b
								
							
						
					
					
						commit
						930f2f3e2d
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -324,7 +324,7 @@ static void do_add_nodes(GstPipeWireDeviceProvider *self)
 | 
			
		|||
 | 
			
		||||
    if(self->list_only) {
 | 
			
		||||
      self->devices = g_list_insert_sorted (self->devices,
 | 
			
		||||
                                            gst_object_ref_sink (device),
 | 
			
		||||
                                            gst_object_ref (device),
 | 
			
		||||
                                            compare_device_session_priority);
 | 
			
		||||
    } else {
 | 
			
		||||
      gst_object_ref (device);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue