]> Pileus Git - ~andy/gtk/commitdiff
Make sure that the quarks are initialized before using them. (#353736)
authorMatthias Clasen <mclasen@redhat.com>
Mon, 2 Oct 2006 05:22:27 +0000 (05:22 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 2 Oct 2006 05:22:27 +0000 (05:22 +0000)
2006-10-02  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtksizegroup.c: Make sure that the quarks are
initialized before using them.  (#353736)

ChangeLog
gtk/gtksizegroup.c

index 070c19dfa5361a70b6f1daaa02437da911424050..b5b94b8b4a8ef8bce38bb88f4d0ec5b99cb610d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-10-02  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtksizegroup.c: Make sure that the quarks are 
+       initialized before using them.  (#353736)
+
        * gtk/Makefile.am (stamp-icons): Use rm instead of ln -f to
        replace existing links.  (#354849, James Evans)
 
index ecd42c0fd722f0bc2eaaa3ca063fe826eb277d56..a57bc451e32ff7e7ae4c9ecb14dcbd8f514681f8 100644 (file)
@@ -253,6 +253,16 @@ queue_resize_on_group (GtkSizeGroup *size_group)
     queue_resize_on_widget (size_group->widgets->data, TRUE);
 }
 
+static void
+initialize_size_group_quarks (void)
+{
+  if (!size_groups_quark)
+    {
+      size_groups_quark = g_quark_from_static_string (size_groups_tag);
+      visited_quark = g_quark_from_string (visited_tag);
+    }
+}
+
 static void
 gtk_size_group_class_init (GtkSizeGroupClass *klass)
 {
@@ -286,9 +296,8 @@ gtk_size_group_class_init (GtkSizeGroupClass *klass)
                                                            "when determining the size of the group"),
                                                         FALSE,
                                                         GTK_PARAM_READWRITE));
-
-  size_groups_quark = g_quark_from_static_string (size_groups_tag);
-  visited_quark = g_quark_from_string (visited_tag);
+  
+  initialize_size_group_quarks ();
 }
 
 static void
@@ -356,7 +365,7 @@ gtk_size_group_get_property (GObject      *object,
  * Return value: a newly created #GtkSizeGroup
  **/
 GtkSizeGroup *
-gtk_size_group_new (GtkSizeGroupMode  mode)
+gtk_size_group_new (GtkSizeGroupMode mode)
 {
   GtkSizeGroup *size_group = g_object_new (GTK_TYPE_SIZE_GROUP, NULL);
 
@@ -510,8 +519,8 @@ gtk_size_group_add_widget (GtkSizeGroup     *size_group,
  * Removes a widget from a #GtkSizeGroup.
  **/
 void
-gtk_size_group_remove_widget (GtkSizeGroup     *size_group,
-                             GtkWidget        *widget)
+gtk_size_group_remove_widget (GtkSizeGroup *size_group,
+                             GtkWidget    *widget)
 {
   GSList *groups;
   
@@ -548,7 +557,7 @@ gtk_size_group_remove_widget (GtkSizeGroup     *size_group,
 GSList *
 gtk_size_group_get_widgets (GtkSizeGroup *size_group)
 {
-     return size_group->widgets;
+  return size_group->widgets;
 }
 
 static gint
@@ -732,6 +741,8 @@ void
 _gtk_size_group_get_child_requisition (GtkWidget      *widget,
                                       GtkRequisition *requisition)
 {
+  initialize_size_group_quarks ();
+
   if (requisition)
     {
       if (get_size_groups (widget))
@@ -761,6 +772,8 @@ _gtk_size_group_compute_requisition (GtkWidget      *widget,
   gint width;
   gint height;
 
+  initialize_size_group_quarks ();
+
   if (get_size_groups (widget))
     {
       /* Only do the full computation if we actually have size groups */
@@ -792,6 +805,8 @@ _gtk_size_group_compute_requisition (GtkWidget      *widget,
 void
 _gtk_size_group_queue_resize (GtkWidget *widget)
 {
+  initialize_size_group_quarks ();
+
   queue_resize_on_widget (widget, TRUE);
 }