diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-06-24 19:16:23 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-06-24 19:16:23 (GMT) |
commit | d614d4b09230411455ed07aac289025a55633da8 (patch) | |
tree | c94a14097f9e97b21e5780852589d167ca68ba59 /src/gui/core | |
parent | afc9e5510d9520928480042a56a193dd71db6a01 (diff) |
Referenced all accesses to the main window.
Diffstat (limited to 'src/gui/core')
-rw-r--r-- | src/gui/core/global.c | 14 |
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; } |