summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-06-24 20:41:55 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-06-24 20:41:55 (GMT)
commita2c5f23381d2aa06e5455c8e377d3d90db6d9a6c (patch)
tree0dd96ee8858764e14e784022fc9628945bb3c112 /src
parentd614d4b09230411455ed07aac289025a55633da8 (diff)
Prevented GCC to warn about an impossible case.
Diffstat (limited to 'src')
-rw-r--r--src/main.c20
1 files 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();