aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-dbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ephy-dbus.c')
-rw-r--r--src/ephy-dbus.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/ephy-dbus.c b/src/ephy-dbus.c
index cdef34752..61367f7a5 100644
--- a/src/ephy-dbus.c
+++ b/src/ephy-dbus.c
@@ -349,15 +349,23 @@ ephy_dbus_shutdown (EphyDbus *dbus)
dbus->priv->reconnect_timeout_id = 0;
}
- dbus_connection_remove_filter
- (dbus_g_connection_get_connection (dbus->priv->session_bus),
- session_filter_func, dbus);
- ephy_dbus_disconnect_bus (dbus->priv->session_bus);
-
- dbus_connection_remove_filter
- (dbus_g_connection_get_connection (dbus->priv->system_bus),
- system_filter_func, dbus);
- ephy_dbus_disconnect_bus (dbus->priv->system_bus);
+ if (dbus->priv->session_bus)
+ {
+ dbus_connection_remove_filter
+ (dbus_g_connection_get_connection (dbus->priv->session_bus),
+ session_filter_func, dbus);
+ ephy_dbus_disconnect_bus (dbus->priv->session_bus);
+ dbus->priv->session_bus = NULL;
+ }
+
+ if (dbus->priv->system_bus)
+ {
+ dbus_connection_remove_filter
+ (dbus_g_connection_get_connection (dbus->priv->system_bus),
+ system_filter_func, dbus);
+ ephy_dbus_disconnect_bus (dbus->priv->system_bus);
+ dbus->priv->system_bus = NULL;
+ }
}
DBusGConnection *