summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/editem.c9
-rw-r--r--src/gui/editor.c2
-rw-r--r--src/gui/tb/portions.c2
3 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/editem.c b/src/gui/editem.c
index ef7cb30..96d63c7 100644
--- a/src/gui/editem.c
+++ b/src/gui/editem.c
@@ -129,7 +129,14 @@ const char *g_editor_item_get_name(const GEditorItem *item)
GtkWidget *g_editor_item_get_widget(const GEditorItem *item)
{
- return item->widget;
+ GtkWidget *result; /* Composant à retourner */
+
+ result = item->widget;
+
+ if (result != NULL)
+ g_object_ref(G_OBJECT(result));
+
+ return result;
}
diff --git a/src/gui/editor.c b/src/gui/editor.c
index 60e4095..6a270fb 100644
--- a/src/gui/editor.c
+++ b/src/gui/editor.c
@@ -262,6 +262,7 @@ GtkWidget *create_editor(void)
menuboard = g_editor_item_get_widget(editem);
gtk_box_pack_start(GTK_BOX(vbox1), menuboard, FALSE, FALSE, 0);
+ g_object_unref(G_OBJECT(menuboard));
g_object_set_data(ref, "menubar", editem);
g_object_set_data(ref, "menuboard", menuboard);
@@ -291,6 +292,7 @@ GtkWidget *create_editor(void)
widget = g_editor_item_get_widget(editem);
gtk_box_pack_start(GTK_BOX(vbox1), widget, FALSE, FALSE, 0);
+ g_object_unref(G_OBJECT(widget));
/* Autre */
diff --git a/src/gui/tb/portions.c b/src/gui/tb/portions.c
index a8eb606..af7fc6c 100644
--- a/src/gui/tb/portions.c
+++ b/src/gui/tb/portions.c
@@ -241,6 +241,8 @@ static void change_portions_tbitem_current_content(GEditorItem *item, GLoadedCon
else
gtk_widget_hide(GTK_WIDGET(widget));
+ g_object_unref(G_OBJECT(widget));
+
}