[glib] Don't assert on backend == settings->priv->backend



commit 4ece333afeb046b60eaa5fd512694e5c8f1587a6
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Apr 7 21:25:01 2011 -0400

    Don't assert on backend == settings->priv->backend
    
    They could be different if a notification is queued for delivery and
    someone calls g_settings_delay().
    
    Bug #646843.

 gio/gsettings.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/gio/gsettings.c b/gio/gsettings.c
index d7c5f30..af2ab3c 100644
--- a/gio/gsettings.c
+++ b/gio/gsettings.c
@@ -311,7 +311,17 @@ settings_backend_changed (GObject             *target,
   gboolean ignore_this;
   gint i;
 
-  g_assert (settings->priv->backend == backend);
+  /* We used to assert here:
+   *
+   *   settings->priv->backend == backend
+   *
+   * but it could be the case that a notification is queued for delivery
+   * while someone calls g_settings_delay() (which changes the backend).
+   *
+   * Since the delay backend would just pass that straight through
+   * anyway, it doesn't make sense to try to detect this case.
+   * Therefore, we just accept it.
+   */
 
   for (i = 0; key[i] == settings->priv->path[i]; i++);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]