summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-07-24 02:21:58 +0200
committerLennart Poettering <lennart@poettering.net>2008-07-24 02:21:58 +0200
commit49f09d6d0eadd67d75190a9001fe715dc486cd36 (patch)
tree7bf884aa215d71e6b8099843897f4f055e4e89ce /src
parent23a3c55c5152977a0f4addcce9f5d4085a8105a4 (diff)
fix destruction of dbus modules: make sure we don't leave filter function registered after unreffing the dbus connection
Diffstat (limited to 'src')
-rw-r--r--src/modules/module-bt-proximity.c1
-rw-r--r--src/modules/module-console-kit.c11
-rw-r--r--src/modules/module-hal-detect.c14
3 files changed, 23 insertions, 3 deletions
diff --git a/src/modules/module-bt-proximity.c b/src/modules/module-bt-proximity.c
index 77b95868..f924c3cb 100644
--- a/src/modules/module-bt-proximity.c
+++ b/src/modules/module-bt-proximity.c
@@ -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
diff --git a/src/modules/module-console-kit.c b/src/modules/module-console-kit.c
index 829b43b1..3578212e 100644
--- a/src/modules/module-console-kit.c
+++ b/src/modules/module-console-kit.c
@@ -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);
}
diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c
index 19430a3d..ec064961 100644
--- a/src/modules/module-hal-detect.c
+++ b/src/modules/module-hal-detect.c
@@ -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);
}