[hafqa] [hafqa] [Bug 1169] New: [PATCH] GLIB-CRITICAL when setting the GtkComboBox model to NULL

From: bugzilla-daemon at maemo.org bugzilla-daemon at maemo.org
Date: Fri Mar 23 13:38:42 EET 2007
https://maemo.org/bugzilla/show_bug.cgi?id=1169

           Summary: [PATCH] GLIB-CRITICAL when setting the GtkComboBox model
                    to NULL
           Product: haf
           Version: sardine
          Platform: All
        OS/Version: Linux
            Status: NEW
          Keywords: patch
          Severity: normal
          Priority: P2
         Component: gtk
        AssignedTo: xan.lopez at nokia.com
        ReportedBy: gabriel.schulhof at nokia.com
         QAContact: hafqa at maemo.org


# The function gtk_combo_box_set_model does not return when
# ->priv->model == model. As a result, when unsetting the model
# while the model is already NULL, the function goes to a place
# it's not supposed to (it calls gtk_cell_view_set_displayed_row,
# which, in turn, accesses the model assuming it's not NULL).
#
# This fix is backported from upstream SVN GTK. Only the top of
# the function gtk_combo_box_set_model is modified. I have added
# the MAEMO_CHANGES line to the backport where I deemed appropriate.
#
# HTH
#
--- gtkcombobox.c.orig  2007-03-23 13:04:00.000000000 +0200
+++ gtkcombobox.c       2007-03-23 12:51:08.000000000 +0200
@@ -4818,23 +4818,18 @@
                          GtkTreeModel *model)
 {
   g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
-
-  if (!model)
-    {
-      gtk_combo_box_unset_model (combo_box);
-#ifdef MAEMO_CHANGES
-      maemo_check_autodim (combo_box);
-#endif /* MAEMO_CHANGES */
-      return;
-    }
-
-  g_return_if_fail (GTK_IS_TREE_MODEL (model));
+  g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));

   if (model == combo_box->priv->model)
     return;

-  if (combo_box->priv->model)
-    gtk_combo_box_unset_model (combo_box);
+  gtk_combo_box_unset_model (combo_box);
+#ifdef MAEMO_CHANGES
+  maemo_check_autodim (combo_box);
+#endif
+
+  if (model == NULL)
+    return;

   combo_box->priv->model = model;
   g_object_ref (combo_box->priv->model);

-- 
Configure bugmail: https://maemo.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the hafqa mailing list