mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
fix destruction of dbus modules: make sure we don't leave filter function registered after unreffing the dbus connection
This commit is contained in:
parent
23a3c55c51
commit
49f09d6d0e
3 changed files with 23 additions and 3 deletions
|
|
@ -358,7 +358,6 @@ static int add_matches(struct userdata *u, pa_bool_t add) {
|
|||
} else
|
||||
dbus_bus_remove_match(pa_dbus_connection_get(u->dbus_connection), filter2, &e);
|
||||
|
||||
|
||||
if (add)
|
||||
pa_assert_se(dbus_connection_add_filter(pa_dbus_connection_get(u->dbus_connection), filter_func, u, NULL));
|
||||
else
|
||||
|
|
|
|||
|
|
@ -341,8 +341,17 @@ void pa__done(pa_module *m) {
|
|||
pa_hashmap_free(u->sessions, NULL, NULL);
|
||||
}
|
||||
|
||||
if (u->connection)
|
||||
if (u->connection) {
|
||||
DBusError error;
|
||||
dbus_error_init(&error);
|
||||
|
||||
dbus_bus_remove_match(pa_dbus_connection_get(u->connection), "type='signal',sender='org.freedesktop.ConsoleKit', interface='org.freedesktop.ConsoleKit.Seat'", &error);
|
||||
dbus_error_free(&error);
|
||||
|
||||
dbus_connection_remove_filter(pa_dbus_connection_get(u->connection), filter_cb, u);
|
||||
|
||||
pa_dbus_connection_unref(u->connection);
|
||||
}
|
||||
|
||||
pa_xfree(u);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -842,8 +842,20 @@ void pa__done(pa_module *m) {
|
|||
if (u->devices)
|
||||
pa_hashmap_free(u->devices, hal_device_free_cb, NULL);
|
||||
|
||||
if (u->connection)
|
||||
if (u->connection) {
|
||||
DBusError error;
|
||||
dbus_error_init(&error);
|
||||
|
||||
dbus_bus_remove_match(pa_dbus_connection_get(u->connection), "type='signal',sender='org.freedesktop.Hal', interface='org.freedesktop.Hal.Device.AccessControl'", &error);
|
||||
dbus_error_free(&error);
|
||||
|
||||
dbus_bus_remove_match(pa_dbus_connection_get(u->connection), "type='signal',interface='org.pulseaudio.Server'", &error);
|
||||
dbus_error_free(&error);
|
||||
|
||||
dbus_connection_remove_filter(pa_dbus_connection_get(u->connection), filter_cb, u);
|
||||
|
||||
pa_dbus_connection_unref(u->connection);
|
||||
}
|
||||
|
||||
pa_xfree(u);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue