diff options
author | Crispin Flowerday <gnome@flowerday.cx> | 2006-01-22 21:09:17 +0800 |
---|---|---|
committer | Crispin Flowerday <crispin@src.gnome.org> | 2006-01-22 21:09:17 +0800 |
commit | ddc468228b25b1fe64a4926acdd176fab188d173 (patch) | |
tree | 7bff281f846873c510598c58aa082dc45642b704 /src/ephy-dbus.c | |
parent | dc7da130e79afb2cbcbcd682cd43fc94d02ed818 (diff) | |
download | gsoc2013-epiphany-ddc468228b25b1fe64a4926acdd176fab188d173.tar gsoc2013-epiphany-ddc468228b25b1fe64a4926acdd176fab188d173.tar.gz gsoc2013-epiphany-ddc468228b25b1fe64a4926acdd176fab188d173.tar.bz2 gsoc2013-epiphany-ddc468228b25b1fe64a4926acdd176fab188d173.tar.lz gsoc2013-epiphany-ddc468228b25b1fe64a4926acdd176fab188d173.tar.xz gsoc2013-epiphany-ddc468228b25b1fe64a4926acdd176fab188d173.tar.zst gsoc2013-epiphany-ddc468228b25b1fe64a4926acdd176fab188d173.zip |
Add guards to avoid crashing on exit if system bus isn't running. Fixes
2006-01-22 Crispin Flowerday <gnome@flowerday.cx>
* src/ephy-dbus.c (ephy_dbus_shutdown):
Add guards to avoid crashing on exit if system bus
isn't running. Fixes bug #327845
Diffstat (limited to 'src/ephy-dbus.c')
-rw-r--r-- | src/ephy-dbus.c | 26 |
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 * |