diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-05 07:44:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-05 07:44:47 +0400 |
commit | 1a9cde8b998fc79c58caefae83dad8493c213aee (patch) | |
tree | 6fd81a4570f37b764f87ce3c9f8e121b5013a083 /source/blender/editors/space_file/filelist.c | |
parent | f44b54d2a7866033025bd4e99992a72e3a27c428 (diff) |
patch [#34103] dir_contents.patch
from Lawrence D'Oliveiro (ldo)
- storage.c: Simplify BLI_dir_contents and make it and its internal subsidiary routines reentrant
- Moved common code for disposal of a struct direntry to new routine BLI_free_filelist in storage.c, and put calls to it in interface_icons.c and filelist.c
- Took out inclusion of BLI_fileops_types.h from BLI_fileops.h and put it explicitly into .c files that need it (which turned out to be only 7 of the 35 files that were including the former)
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 5f2e20e68dd..5be780ff0b4 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -48,6 +48,7 @@ #include "BLI_linklist.h" #include "BLI_threads.h" #include "BLI_utildefines.h" +#include "BLI_fileops_types.h" #ifdef WIN32 # include "BLI_winstuff.h" @@ -545,8 +546,6 @@ FileList *filelist_new(short type) void filelist_free(struct FileList *filelist) { - int i; - if (!filelist) { printf("Attempting to delete empty filelist.\n"); return; @@ -557,23 +556,8 @@ void filelist_free(struct FileList *filelist) filelist->fidx = NULL; } - for (i = 0; i < filelist->numfiles; ++i) { - if (filelist->filelist[i].image) { - IMB_freeImBuf(filelist->filelist[i].image); - } - filelist->filelist[i].image = NULL; - if (filelist->filelist[i].relname) - MEM_freeN(filelist->filelist[i].relname); - if (filelist->filelist[i].path) - MEM_freeN(filelist->filelist[i].path); - filelist->filelist[i].relname = NULL; - if (filelist->filelist[i].string) - MEM_freeN(filelist->filelist[i].string); - filelist->filelist[i].string = NULL; - } - + BLI_free_filelist(filelist->filelist, filelist->numfiles); filelist->numfiles = 0; - free(filelist->filelist); filelist->filelist = NULL; filelist->filter = 0; filelist->filter_glob[0] = '\0'; |