[Bf-blender-cvs] [7cb8a89] asset-experiments: Fix that stupid memleak in job-dir-listing code.
Bastien Montagne
noreply at git.blender.org
Thu Dec 11 20:12:32 CET 2014
Commit: 7cb8a89aa027702de50be3d2ecd7c89ac570718c
Author: Bastien Montagne
Date: Thu Dec 11 17:46:46 2014 +0100
Branches: asset-experiments
https://developer.blender.org/rB7cb8a89aa027702de50be3d2ecd7c89ac570718c
Fix that stupid memleak in job-dir-listing code.
===================================================================
M source/blender/editors/space_file/filelist.c
===================================================================
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 8964f71..744c3cc 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -2079,6 +2079,8 @@ static void filelist_readjob_update(void *flrjv)
if (flrj->tmp_filelist->numfiles != flrj->filelist->numfiles) {
num_new_entries = flrj->tmp_filelist->numfiles;
+ /* This way we are sure we won't share any mem with background job! */
+ /* Note direntry->poin is not handled here, sure not matter though. */
BLI_duplicate_filelist(&new_entries, flrj->tmp_filelist->filelist, num_new_entries);
}
@@ -2117,12 +2119,7 @@ static void filelist_readjob_free(void *flrjv)
if (flrj->tmp_filelist) {
filelist_freelib(flrj->tmp_filelist);
- /* filelist_free(flrj->tmp_filelist); */
- /* Do not use that here, it would also free data inside tmp_filelist->filelist,
- * which have actually be 'transferred' to filelist->filelist. */
- if (flrj->tmp_filelist->filelist) {
- free(flrj->tmp_filelist->filelist);
- }
+ filelist_free(flrj->tmp_filelist);
/* tmp_filelist shall never ever be filtered! */
BLI_assert(flrj->tmp_filelist->fidx == NULL);
}
More information about the Bf-blender-cvs
mailing list