summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--docs/reference/gtk/tmpl/gtkbuildable.sgml3
-rw-r--r--gtk/gtkbuilder.c1
-rw-r--r--gtk/gtkuimanager.c2
4 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 24ca93e3ad..e0aae44431 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2006-11-26 Ryan Lortie <desrt@desrt.ca>
+ * docs/reference/gtk/tmpl/gtkbuildable.sgml: add clarification stating
+ that the construct_child function is responsible for returning a
+ reference.
+ * gtkbuilder.c (_gtk_builder_construct): remove g_object_ref() for
+ objects from constructors
+ * gtkuimanager.c (gtk_ui_manager_buildable_construct_child): add
+ g_object_ref() to this construction function (it's the only
+ implementer in GTK)
+
+ Fixes #496645.
+
+2006-11-26 Ryan Lortie <desrt@desrt.ca>
+
* gtkbuilder.c: remove concept of root objects and just refcount
all objects in the builder. Fixes #496651.
diff --git a/docs/reference/gtk/tmpl/gtkbuildable.sgml b/docs/reference/gtk/tmpl/gtkbuildable.sgml
index a140d78688..16857ae60c 100644
--- a/docs/reference/gtk/tmpl/gtkbuildable.sgml
+++ b/docs/reference/gtk/tmpl/gtkbuildable.sgml
@@ -61,7 +61,8 @@ a GtkBuilder UI definition.
@construct_child: Constructs a child of a buildable that has been
specified as "constructor" in the UI definition. #GtkUIManager implements
this to reference to a widget created in a &lt;ui&gt; tag which is outside
- of the normal GtkBuilder UI definition hierarchy.
+ of the normal GtkBuilder UI definition hierarchy. A reference to the
+ constructed object is returned and becomes owned by the caller.
@custom_tag_start: Implement this if the buildable needs to parse
content below &lt;child&gt;. To handle an element, the implementation
must fill in the @parser structure and @user_data and return %TRUE.
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index 5f6e1dff88..263698b22a 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -402,7 +402,6 @@ _gtk_builder_construct (GtkBuilder *builder,
g_assert (obj != NULL);
if (construct_parameters->len)
g_warning ("Can't pass in construct-only parameters to %s", info->id);
- g_object_ref (obj);
}
else if (info->parent && ((ChildInfo*)info->parent)->internal_child != NULL)
{
diff --git a/gtk/gtkuimanager.c b/gtk/gtkuimanager.c
index 9528bc41f5..2273579d1a 100644
--- a/gtk/gtkuimanager.c
+++ b/gtk/gtkuimanager.c
@@ -497,7 +497,7 @@ gtk_ui_manager_buildable_construct_child (GtkBuildable *buildable,
g_signal_connect (widget, "hierarchy-changed",
G_CALLBACK (child_hierarchy_changed_cb),
GTK_UI_MANAGER (buildable));
- return G_OBJECT (widget);
+ return g_object_ref (widget);
}
static void