summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2012-02-13 23:35:06 -0500
committerRay Strode <rstrode@redhat.com>2012-02-13 23:45:17 -0500
commit6f3e127330cb0820a373be77be3cb2cacd0b352e (patch)
tree91a8f79aa57838c737c6d471ce9ad9963ea88c2a
parent0bc3a90c2178ae0dd42029f7ad227fa7f44d6c0c (diff)
downloadgconf-6f3e127330cb0820a373be77be3cb2cacd0b352e.tar.gz
gconf-dbus: don't crash during sync if gconfd shutting down
The gconfd shuts down after a bit of inactivity. When that happens there's a window where it refuses requests from the client library with an error. The library is resposible for gracefully handling this condition and reacting appropriately. There are many places in the code where the client library has this idiom: db = gconf_engine_get_database (conf, TRUE, err); if (db == NULL) { g_return_if_fail(err == NULL || *err != NULL); return; } In the event gconfd is shutting down, db will be NULL, and the code will return early from whatever (non-critical) operation it was doing. gconf_engine_suggest_sync has a similiar chunk of code, but it neglected the "return;" and then promptly crashed since it wasn't expecting db to be NULL. This commit adds the return; https://bugzilla.gnome.org/show_bug.cgi?id=670033
-rw-r--r--gconf/gconf-dbus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gconf/gconf-dbus.c b/gconf/gconf-dbus.c
index 9f92125d..442a94b8 100644
--- a/gconf/gconf-dbus.c
+++ b/gconf/gconf-dbus.c
@@ -2029,6 +2029,7 @@ gconf_engine_suggest_sync(GConfEngine* conf, GError** err)
if (db == NULL)
{
g_return_if_fail (err == NULL || *err != NULL);
+ return;
}
message = dbus_message_new_method_call (GCONF_DBUS_SERVICE,