mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	module: Remove redundant core argument from pa_module_unload()
pa_module_unload() takes two pointers: pa_module and pa_core. The pa_core pointer is also available via the pa_module object, so the pa_core argument is redundant [David Henningsson: Rebased to git HEAD]
This commit is contained in:
		
							parent
							
								
									cda1a5e897
								
							
						
					
					
						commit
						96b368b960
					
				
					 6 changed files with 8 additions and 9 deletions
				
			
		| 
						 | 
					@ -2414,7 +2414,7 @@ static pa_hook_result_t discovery_hook_cb(pa_bluez4_discovery *y, const pa_bluez
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        return PA_HOOK_OK;
 | 
					        return PA_HOOK_OK;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_module_unload(u->core, u->module, true);
 | 
					    pa_module_unload(u->module, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return PA_HOOK_OK;
 | 
					    return PA_HOOK_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2035,7 +2035,7 @@ static pa_hook_result_t device_connection_changed_cb(pa_bluetooth_discovery *y,
 | 
				
			||||||
        return PA_HOOK_OK;
 | 
					        return PA_HOOK_OK;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_log_debug("Unloading module for device %s", d->path);
 | 
					    pa_log_debug("Unloading module for device %s", d->path);
 | 
				
			||||||
    pa_module_unload(u->core, u->module, true);
 | 
					    pa_module_unload(u->module, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return PA_HOOK_OK;
 | 
					    return PA_HOOK_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -643,7 +643,7 @@ static int avahi_process_msg(pa_msgobject *o, int code, void *data, int64_t offs
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case AVAHI_MESSAGE_SHUTDOWN_START:
 | 
					        case AVAHI_MESSAGE_SHUTDOWN_START:
 | 
				
			||||||
            pa_module_unload(u->core, u->module, true);
 | 
					            pa_module_unload(u->module, true);
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        default:
 | 
					        default:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -51,7 +51,7 @@ static int core_process_msg(pa_msgobject *o, int code, void *userdata, int64_t o
 | 
				
			||||||
    switch (code) {
 | 
					    switch (code) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case PA_CORE_MESSAGE_UNLOAD_MODULE:
 | 
					        case PA_CORE_MESSAGE_UNLOAD_MODULE:
 | 
				
			||||||
            pa_module_unload(c, userdata, true);
 | 
					            pa_module_unload(userdata, true);
 | 
				
			||||||
            return 0;
 | 
					            return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        default:
 | 
					        default:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -259,14 +259,13 @@ static void pa_module_free(pa_module *m) {
 | 
				
			||||||
    pa_xfree(m);
 | 
					    pa_xfree(m);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void pa_module_unload(pa_core *c, pa_module *m, bool force) {
 | 
					void pa_module_unload(pa_module *m, bool force) {
 | 
				
			||||||
    pa_assert(c);
 | 
					 | 
				
			||||||
    pa_assert(m);
 | 
					    pa_assert(m);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (m->core->disallow_module_loading && !force)
 | 
					    if (m->core->disallow_module_loading && !force)
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!(m = pa_idxset_remove_by_data(c->modules, m, NULL)))
 | 
					    if (!(m = pa_idxset_remove_by_data(m->core->modules, m, NULL)))
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_module_free(m);
 | 
					    pa_module_free(m);
 | 
				
			||||||
| 
						 | 
					@ -334,7 +333,7 @@ static void defer_cb(pa_mainloop_api*api, pa_defer_event *e, void *userdata) {
 | 
				
			||||||
    api->defer_enable(e, 0);
 | 
					    api->defer_enable(e, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    while ((m = pa_hashmap_first(c->modules_pending_unload)))
 | 
					    while ((m = pa_hashmap_first(c->modules_pending_unload)))
 | 
				
			||||||
        pa_module_unload(c, m, true);
 | 
					        pa_module_unload(m, true);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void pa_module_unload_request(pa_module *m, bool force) {
 | 
					void pa_module_unload_request(pa_module *m, bool force) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,7 +54,7 @@ bool pa_module_exists(const char *name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pa_module* pa_module_load(pa_core *c, const char *name, const char *argument);
 | 
					pa_module* pa_module_load(pa_core *c, const char *name, const char *argument);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void pa_module_unload(pa_core *c, pa_module *m, bool force);
 | 
					void pa_module_unload(pa_module *m, bool force);
 | 
				
			||||||
void pa_module_unload_by_index(pa_core *c, uint32_t idx, bool force);
 | 
					void pa_module_unload_by_index(pa_core *c, uint32_t idx, bool force);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void pa_module_unload_request(pa_module *m, bool force);
 | 
					void pa_module_unload_request(pa_module *m, bool force);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue