[glade/glade-3-8] Fixed bug 702886 "SEGV when creating a new GtkDialog (GLib 2.37.x)" glib changed the order construct



commit 9aa539e209281201256a71e2ebc434f7fd97262b
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Thu Sep 5 15:14:03 2013 -0300

    Fixed bug 702886 "SEGV when creating a new GtkDialog (GLib 2.37.x)"
    glib changed the order construct properties are set which exposed this bug,
    now they are set in the order they are installed in the class.
    So we fixed the bug by installing adaptor property first and object last.

 gladeui/glade-widget.c |   41 ++++++++++++++++++++++-------------------
 1 files changed, 22 insertions(+), 19 deletions(-)
---
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index 4a97403..d573b5c 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -84,11 +84,10 @@ enum
 enum
 {
        PROP_0,
+       PROP_ADAPTOR,
        PROP_NAME,
        PROP_INTERNAL,
        PROP_ANARCHIST,
-       PROP_OBJECT,
-       PROP_ADAPTOR,
        PROP_PROJECT,
        PROP_PROPERTIES,
        PROP_PARENT,
@@ -98,7 +97,8 @@ enum
        PROP_REASON,
        PROP_TOPLEVEL_WIDTH,
        PROP_TOPLEVEL_HEIGHT,
-       PROP_SUPPORT_WARNING
+       PROP_SUPPORT_WARNING,
+       PROP_OBJECT
 };
 
 static guint         glade_widget_signals[LAST_SIGNAL] = {0};
@@ -1084,6 +1084,14 @@ glade_widget_class_init (GladeWidgetClass *klass)
        klass->motion_notify_event    = NULL;
 
        g_object_class_install_property
+               (object_class, PROP_ADAPTOR,
+                  g_param_spec_object ("adaptor", _("Adaptor"),
+                                       _("The class adaptor for the associated widget"),
+                                       GLADE_TYPE_WIDGET_ADAPTOR,
+                                       G_PARAM_READWRITE |
+                                       G_PARAM_CONSTRUCT_ONLY));
+       
+       g_object_class_install_property
                (object_class, PROP_NAME,
                 g_param_spec_string ("name", _("Name"),
                                      _("The name of the widget"),
@@ -1107,22 +1115,6 @@ glade_widget_class_init (GladeWidgetClass *klass)
                                       G_PARAM_CONSTRUCT_ONLY));
 
        g_object_class_install_property
-               (object_class, PROP_OBJECT,
-                g_param_spec_object ("object", _("Object"),
-                                     _("The object associated"),
-                                     G_TYPE_OBJECT,
-                                     G_PARAM_READWRITE |
-                                     G_PARAM_CONSTRUCT));
-
-       g_object_class_install_property
-               (object_class, PROP_ADAPTOR,
-                  g_param_spec_object ("adaptor", _("Adaptor"),
-                                       _("The class adaptor for the associated widget"),
-                                       GLADE_TYPE_WIDGET_ADAPTOR,
-                                       G_PARAM_READWRITE |
-                                       G_PARAM_CONSTRUCT_ONLY));
-
-       g_object_class_install_property
                (object_class, PROP_PROJECT,
                 g_param_spec_object ("project", _("Project"),
                                      _("The glade project that "
@@ -1200,6 +1192,17 @@ glade_widget_class_init (GladeWidgetClass *klass)
                                      _("A warning string about version mismatches"),
                                      NULL, G_PARAM_READABLE));
 
+       /* this property setter depends on adaptor and internal properties to be set
+        * so we install it at the end since in new glib construct properties are
+        * set in instalation order!
+        */
+       g_object_class_install_property
+               (object_class, PROP_OBJECT,
+                g_param_spec_object ("object", _("Object"),
+                                     _("The object associated"),
+                                     G_TYPE_OBJECT,
+                                     G_PARAM_READWRITE));
+
        /**
         * GladeWidget::add-signal-handler:
         * @gladewidget: the #GladeWidget which received the signal.


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