From 0fd147543d2af1c285393daa92f87070926166d6 Mon Sep 17 00:00:00 2001 From: monsta Date: Mon, 27 Mar 2017 15:32:25 +0300 Subject: modelines: fix random crash on closing one of several Pluma windows ported from: https://git.gnome.org/browse/gedit/commit/?id=b8b6fe708eddd6a9d471ecd04c38e790d8c0bc7c --- plugins/modelines/modeline-parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/modelines/modeline-parser.c b/plugins/modelines/modeline-parser.c index c1d96140..0ab477e7 100644 --- a/plugins/modelines/modeline-parser.c +++ b/plugins/modelines/modeline-parser.c @@ -82,7 +82,8 @@ has_option (ModelineOptions *options, void modeline_parser_init (const gchar *data_dir) { - modelines_data_dir = g_strdup (data_dir); + if (modelines_data_dir == NULL) + modelines_data_dir = g_strdup (data_dir); } void @@ -102,6 +103,7 @@ modeline_parser_shutdown () kate_languages = NULL; g_free (modelines_data_dir); + modelines_data_dir = NULL; } static GHashTable * -- cgit v1.2.1