summaryrefslogtreecommitdiff
path: root/src/gui/core
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-06-24 19:16:23 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-06-24 19:16:23 (GMT)
commitd614d4b09230411455ed07aac289025a55633da8 (patch)
treec94a14097f9e97b21e5780852589d167ca68ba59 /src/gui/core
parentafc9e5510d9520928480042a56a193dd71db6a01 (diff)
Referenced all accesses to the main window.
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;
}