mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	dbus: remove filter functions only if they were actually set before
This fixes an assert when destructing modules that have not been fully initialized. https://bugzilla.redhat.com/show_bug.cgi?id=548525
This commit is contained in:
		
							parent
							
								
									5e2a80c7e3
								
							
						
					
					
						commit
						66dbca1e06
					
				
					 7 changed files with 34 additions and 34 deletions
				
			
		| 
						 | 
				
			
			@ -179,6 +179,8 @@ struct userdata {
 | 
			
		|||
 | 
			
		||||
    int stream_write_type;
 | 
			
		||||
    int service_write_type, service_read_type;
 | 
			
		||||
 | 
			
		||||
    pa_bool_t filter_added;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define FIXED_LATENCY_PLAYBACK_A2DP (25*PA_USEC_PER_MSEC)
 | 
			
		||||
| 
						 | 
				
			
			@ -2405,6 +2407,7 @@ int pa__init(pa_module* m) {
 | 
			
		|||
        pa_log_error("Failed to add filter function");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
    u->filter_added = TRUE;
 | 
			
		||||
 | 
			
		||||
    speaker = pa_sprintf_malloc("type='signal',sender='org.bluez',interface='org.bluez.Headset',member='SpeakerGainChanged',path='%s'", u->path);
 | 
			
		||||
    mike = pa_sprintf_malloc("type='signal',sender='org.bluez',interface='org.bluez.Headset',member='MicrophoneGainChanged',path='%s'", u->path);
 | 
			
		||||
| 
						 | 
				
			
			@ -2494,7 +2497,9 @@ void pa__done(pa_module *m) {
 | 
			
		|||
            pa_xfree(mike);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        dbus_connection_remove_filter(pa_dbus_connection_get(u->connection), filter_cb, u);
 | 
			
		||||
        if (u->filter_added)
 | 
			
		||||
            dbus_connection_remove_filter(pa_dbus_connection_get(u->connection), filter_cb, u);
 | 
			
		||||
 | 
			
		||||
        pa_dbus_connection_unref(u->connection);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue