[glade3/glade-3-8] * plugins/gtk+/glade-gtk.c: Make sure any manually created glade widgets pass through glade_widg
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3/glade-3-8] * plugins/gtk+/glade-gtk.c: Make sure any manually created glade widgets pass through glade_widg
- Date: Wed, 15 Dec 2010 15:28:25 +0000 (UTC)
commit 88024f46f2d2b5e5f2eeae10d97c0de5cbb7bfe0
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Dec 16 00:33:59 2010 +0900
* plugins/gtk+/glade-gtk.c: Make sure any manually created glade widgets pass
through glade_widget_add_child() and get a proper ref from the parent (fixing
more last minute crahsers).
* gladeui/glade-utils.c: Fixed crasher bug 628233 partially using patch by
ramz <ramanathan nitt gmail com>.
ChangeLog | 7 +++++++
gladeui/glade-utils.c | 6 ++++--
plugins/gtk+/glade-gtk.c | 14 ++++----------
3 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d7f5124..b68befc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,13 @@
the plugin doesnt screw up, also hold a ref to widgets being rebuilt since
they can go out and into the project.
+ * plugins/gtk+/glade-gtk.c: Make sure any manually created glade widgets pass
+ through glade_widget_add_child() and get a proper ref from the parent (fixing
+ more last minute crahsers).
+
+ * gladeui/glade-utils.c: Fixed crasher bug 628233 partially using patch by
+ ramz <ramanathan nitt gmail com>.
+
2010-12-14 Tristan Van Berkom <tristanvb openismus com>
* Reverted 3.0 commit, now targetting this branch to the final GTK+ 2.x chapter
diff --git a/gladeui/glade-utils.c b/gladeui/glade-utils.c
index e77c8de..78940cb 100644
--- a/gladeui/glade-utils.c
+++ b/gladeui/glade-utils.c
@@ -1094,7 +1094,7 @@ glade_util_find_iter (GtkTreeModel *model,
gint column)
{
GtkTreeIter *retval = NULL;
- GObject* object;
+ GObject* object = NULL;
GtkTreeIter *next;
g_return_val_if_fail (GTK_IS_TREE_MODEL (model), NULL);
@@ -1120,7 +1120,9 @@ glade_util_find_iter (GtkTreeModel *model,
break;
}
- g_object_unref (object);
+ if (object &&
+ gtk_tree_model_get_column_type (model, column) == G_TYPE_OBJECT)
+ g_object_unref (object);
if (!gtk_tree_model_iter_next (model, next))
break;
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index fcfbf98..b344c7f 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -3340,14 +3340,12 @@ glade_gtk_frame_post_create (GladeWidgetAdaptor *adaptor,
NULL);
label_text = g_strdup_printf ("<b>%s</b>", glade_widget_get_name (gframe));
-
glade_widget_property_set (glabel, "label", label_text);
glade_widget_property_set (glabel, "use-markup", "TRUE");
+ g_free (label_text);
g_object_set_data (glabel->object, "special-child-type", "label_item");
- gtk_frame_set_label_widget (GTK_FRAME (frame), GTK_WIDGET (glabel->object));
- gtk_widget_show (GTK_WIDGET (glabel->object));
- g_free (label_text);
+ glade_widget_add_child (gframe, glabel, FALSE);
/* add alignment */
galignment = glade_widget_adaptor_create_widget (alignment_adaptor, FALSE,
@@ -3356,8 +3354,7 @@ glade_gtk_frame_post_create (GladeWidgetAdaptor *adaptor,
NULL);
glade_widget_property_set (galignment, "left-padding", 12);
- gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (galignment->object));
- gtk_widget_show (GTK_WIDGET (galignment->object));
+ glade_widget_add_child (gframe, galignment, FALSE);
}
/* Chain Up */
@@ -4612,10 +4609,7 @@ glade_gtk_expander_post_create (GladeWidgetAdaptor *adaptor,
glade_widget_property_set (glabel, "label", "expander");
g_object_set_data (glabel->object, "special-child-type", "label_item");
- gtk_expander_set_label_widget (GTK_EXPANDER (expander),
- GTK_WIDGET (glabel->object));
-
- gtk_widget_show (GTK_WIDGET (glabel->object));
+ glade_widget_add_child (gexpander, glabel, FALSE);
}
gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]