Free file list memory whilst iterating the list.
Minor formatting fixes. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4201 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
5b708760cf
commit
51370136c6
@ -1,3 +1,10 @@
|
||||
2009-09-17 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
||||
* plugins/filebrowser.c:
|
||||
Free file list memory whilst iterating the list.
|
||||
Minor formatting fixes.
|
||||
|
||||
|
||||
2009-09-16 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
||||
* src/keybindings.c, src/callbacks.c, src/search.c:
|
||||
|
@ -131,7 +131,7 @@ static gboolean check_hidden(const gchar *base_name)
|
||||
}
|
||||
|
||||
|
||||
/* Returns: whether name has been removed by filter. */
|
||||
/* Returns: whether filename should be removed. */
|
||||
static gboolean check_filtered(const gchar *base_name)
|
||||
{
|
||||
if (filter == NULL)
|
||||
@ -141,7 +141,6 @@ static gboolean check_filtered(const gchar *base_name)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -184,8 +183,6 @@ static void add_item(const gchar *name)
|
||||
}
|
||||
gtk_list_store_append(file_store, &iter);
|
||||
}
|
||||
|
||||
|
||||
gtk_list_store_set(file_store, &iter,
|
||||
FILEVIEW_COLUMN_ICON, (dir) ? GTK_STOCK_DIRECTORY : GTK_STOCK_FILE,
|
||||
FILEVIEW_COLUMN_NAME, utf8_name,
|
||||
@ -252,9 +249,20 @@ static void refresh(void)
|
||||
list = utils_get_file_list(current_dir, NULL, NULL);
|
||||
if (list != NULL)
|
||||
{
|
||||
g_slist_foreach(list, (GFunc) add_item, NULL);
|
||||
g_slist_foreach(list, (GFunc) g_free, NULL);
|
||||
g_slist_free(list);
|
||||
GSList *node;
|
||||
|
||||
/* free filenames & nodes as we go through the list */
|
||||
for (node = list; node != NULL;)
|
||||
{
|
||||
gchar *fname = node->data;
|
||||
GSList *old;
|
||||
|
||||
add_item(fname);
|
||||
g_free(fname);
|
||||
old = node;
|
||||
node = node->next;
|
||||
g_slist_free_1(old);
|
||||
}
|
||||
}
|
||||
gtk_entry_completion_set_model(entry_completion, GTK_TREE_MODEL(file_store));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user