Branch: refs/heads/master Author: Frank Lanitz frank@frank.uvena.de Committer: GitHub noreply@github.com Date: Thu, 05 Oct 2017 17:00:35 UTC Commit: 15d41d388621957c5812a02ca5095cfb6e35d14f https://github.com/geany/geany-plugins/commit/15d41d388621957c5812a02ca5095c...
Log Message: ----------- Merge pull request #608 from LarsGit223/wb-apply605
Workbench: fixed not closed file handles on directory scanning (thanks to techee). Fixes #607.
Modified Paths: -------------- workbench/src/plugin_main.c workbench/src/wb_project.c
Modified: workbench/src/plugin_main.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -128,7 +128,7 @@ void geany_load_module(GeanyPlugin *plugin) /* Set metadata */ plugin->info->name = _("Workbench"); plugin->info->description = _("Manage and customize multiple projects."); - plugin->info->version = "1.0"; + plugin->info->version = "1.01"; plugin->info->author = "LarsGit223";
/* Set functions */
Modified: workbench/src/wb_project.c 18 lines changed, 13 insertions(+), 5 deletions(-) =================================================================== @@ -228,6 +228,9 @@ static GSList *wb_project_dir_get_file_list(WB_PROJECT_DIR *root, const gchar *u { GSList *list = NULL; GDir *dir; + const gchar *child_name; + GSList *child = NULL; + GSList *children = NULL; gchar *locale_path = utils_get_locale_from_utf8(utf8_path); gchar *real_path = utils_get_real_path(locale_path);
@@ -245,14 +248,19 @@ static GSList *wb_project_dir_get_file_list(WB_PROJECT_DIR *root, const gchar *u
g_hash_table_insert(visited_paths, real_path, GINT_TO_POINTER(1));
- while (TRUE) + while ((child_name = g_dir_read_name(dir)) != NULL) + { + children = g_slist_prepend(children, g_strdup(child_name)); + } + + g_dir_close(dir); + + foreach_slist(child, children) { const gchar *locale_name; gchar *locale_filename, *utf8_filename, *utf8_name;
- locale_name = g_dir_read_name(dir); - if (!locale_name) - break; + locale_name = child->data;
utf8_name = utils_get_utf8_from_locale(locale_name); locale_filename = g_build_filename(locale_path, locale_name, NULL); @@ -287,7 +295,7 @@ static GSList *wb_project_dir_get_file_list(WB_PROJECT_DIR *root, const gchar *u g_free(utf8_name); }
- g_dir_close(dir); + g_slist_free_full(children, g_free); g_free(locale_path);
return list;
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org