From a2c5f23381d2aa06e5455c8e377d3d90db6d9a6c Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Mon, 24 Jun 2019 22:41:55 +0200
Subject: Prevented GCC to warn about an impossible case.

---
 src/main.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/main.c b/src/main.c
index 3b05581..c2aaf56 100644
--- a/src/main.c
+++ b/src/main.c
@@ -287,12 +287,22 @@ int main(int argc, char **argv)
         if (editor == NULL) goto failed_to_load_editor;
 
         status = load_all_gui_components();
-        if (!status) goto failed_to_load_editor;
+        if (!status) goto failed_to_load_gui_components;
 
         gtk_widget_show_now(editor);
 
     }
 
+    /**
+     * Pour éviter le message de GCC :
+     *
+     *    """
+     *    warning: ‘editor’ may be used uninitialized in this function [-Wmaybe-uninitialized]
+     *    """
+     */
+    else
+        editor = NULL;
+
     init_all_plugins(true);
 
     config = get_main_configuration();
@@ -411,12 +421,14 @@ int main(int argc, char **argv)
     exit_all_plugins();
 
     if (!batch_mode)
-        g_object_unref(G_OBJECT(editor));
+        unload_all_gui_components();
 
- failed_to_load_editor:
+ failed_to_load_gui_components:
 
     if (!batch_mode)
-        unload_all_gui_components();
+        g_object_unref(G_OBJECT(editor));
+
+ failed_to_load_editor:
 
     unload_all_basic_components();
 
-- 
cgit v0.11.2-87-g4458