summaryrefslogtreecommitdiff
path: root/src/gui/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/core')
-rw-r--r--src/gui/core/global.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gui/core/global.c b/src/gui/core/global.c
index bfc2426..7b6afc9 100644
--- a/src/gui/core/global.c
+++ b/src/gui/core/global.c
@@ -63,8 +63,13 @@ G_LOCK_DEFINE_STATIC(_cv_mutex);
void set_editor_window(GtkWindow *editor)
{
+ g_clear_object(&_editor);
+
_editor = editor;
+ if (editor != NULL)
+ g_object_ref(G_OBJECT(editor));
+
}
@@ -82,7 +87,14 @@ void set_editor_window(GtkWindow *editor)
GtkWindow *get_editor_window(void)
{
- return _editor;
+ GtkWindow *result; /* Instance à retourner */
+
+ result = _editor;
+
+ if (result != NULL)
+ g_object_ref(G_OBJECT(result));
+
+ return result;
}