diff options
author | Tanu Kaskinen <tanu.kaskinen@digia.com> | 2011-04-29 13:58:43 +0300 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2011-04-29 12:38:43 +0100 |
commit | 2f7eb35f370bb79c12f229d109fc4dd2b74c9f47 (patch) | |
tree | 45d50ce22a3c52ae1bfd1ddedd002ece8a861579 /src/modules/dbus/module-dbus-protocol.c | |
parent | 7055694023a9feffb5591d51f823794216b3d2b2 (diff) |
dbus: Fix the order of freeing stuff when unloading module-dbus-protocol.
Diffstat (limited to 'src/modules/dbus/module-dbus-protocol.c')
-rw-r--r-- | src/modules/dbus/module-dbus-protocol.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/modules/dbus/module-dbus-protocol.c b/src/modules/dbus/module-dbus-protocol.c index 276c6bae..4969585f 100644 --- a/src/modules/dbus/module-dbus-protocol.c +++ b/src/modules/dbus/module-dbus-protocol.c @@ -592,14 +592,20 @@ void pa__done(pa_module *m) { if (u->core_iface) pa_dbusiface_core_free(u->core_iface); - if (u->cleanup_event) - m->core->mainloop->defer_free(u->cleanup_event); - while ((c = pa_idxset_steal_first(u->connections, NULL))) connection_free(c); pa_idxset_free(u->connections, NULL, NULL); + /* This must not be called before the connections are freed, because if + * there are any connections left, they will emit the + * org.freedesktop.DBus.Local.Disconnected signal, and + * disconnection_filter_cb() will be called. disconnection_filter_cb() then + * tries to enable the defer event, and if it's already freed, an assertion + * will be hit in mainloop.c. */ + if (u->cleanup_event) + m->core->mainloop->defer_free(u->cleanup_event); + if (u->tcp_server) server_free(u->tcp_server); |