diff src/editors.c @ 1463:25168240a247

added function to reload external editors at any time eliminated init_after_global_options()
author nadvornik
date Fri, 20 Mar 2009 09:46:35 +0000
parents 863ac709f6b4
children e9f9d3da3f43
line wrap: on
line diff
--- a/src/editors.c	Thu Mar 19 22:58:28 2009 +0000
+++ b/src/editors.c	Fri Mar 20 09:46:35 2009 +0000
@@ -167,8 +167,10 @@
 		{
 		/* We only consider desktop entries of Application type */
 		g_key_file_free(key_file);
+		g_free(type);
 		return FALSE;
 		}
+	g_free(type);
 	
 	editor = g_new0(EditorDescription, 1);
 	
@@ -334,10 +336,11 @@
 	gchar **split_dirs;
 	gint i;
 	
-	if (!editors)
+	if (editors)
 		{
-		editors = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, (GDestroyNotify)editor_description_free);
+		g_hash_table_destroy(editors);
 		}
+	editors = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, (GDestroyNotify)editor_description_free);
 
 	xdg_data_dirs = getenv("XDG_DATA_DIRS");
 	if (xdg_data_dirs && xdg_data_dirs[0])