[gconf] Avoid assertion failures
- From: Matthias Clasen <matthiasc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gconf] Avoid assertion failures
- Date: Thu, 14 May 2009 11:13:36 -0400 (EDT)
commit ce02b9a3c4391156805ae4a71f7133306c8b7bb0
Author: Matthias Clasen <mclasen redhat com>
Date: Thu May 14 11:11:25 2009 -0400
Avoid assertion failures
The neg-caching patch changed the behaviour of the internal
gconf_client_lookup function. It can now return TRUE, but still
leave entry NULL. Adjust callers. This fixes bug 581905.
---
gconf/gconf-client.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/gconf/gconf-client.c b/gconf/gconf-client.c
index da050ec..98f2051 100644
--- a/gconf/gconf-client.c
+++ b/gconf/gconf-client.c
@@ -1199,7 +1199,8 @@ gconf_client_key_is_writable (GConfClient* client,
if (gconf_client_lookup (client, key, &entry))
{
- g_assert (entry != NULL);
+ if (!entry)
+ return FALSE;
trace ("CACHED: Checking whether key '%s' is writable", key);
return gconf_entry_get_is_writable (entry);
@@ -1406,7 +1407,8 @@ gconf_client_get_default_from_schema (GConfClient* client,
*/
if (gconf_client_lookup (client, key, &entry))
{
- g_assert (entry != NULL);
+ if (!entry)
+ return NULL;
if (gconf_entry_get_is_default (entry))
{
@@ -2498,7 +2500,7 @@ gconf_client_flush_notifies (GConfClient *client)
{
GConfEntry *entry = NULL;
- if (gconf_client_lookup (client, tmp->data, &entry))
+ if (gconf_client_lookup (client, tmp->data, &entry) && entry != NULL)
{
if (entry != last_entry)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]