fix destruction of dbus modules: make sure we don't leave filter function registered after unreffing the dbus connection

This commit is contained in:
Lennart Poettering 2008-07-24 02:21:58 +02:00
parent 23a3c55c51
commit 49f09d6d0e
3 changed files with 23 additions and 3 deletions

View file

@ -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);
}