summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2013-09-05 15:14:03 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2013-09-05 15:14:03 -0300
commit9aa539e209281201256a71e2ebc434f7fd97262b (patch)
tree38215808bd286d4636113a85cbd070a3f0cf7a07
parent5c7b17bef84801f9bc3d97bbd76352c327b56d60 (diff)
downloadglade-9aa539e209281201256a71e2ebc434f7fd97262b.tar.gz
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.
-rw-r--r--gladeui/glade-widget.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index 4a974032..d573b5c2 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.