[Bf-blender-cvs] [d66519f1972] master: Writefile: Cleanup CacheFile runtime data.
Bastien Montagne
noreply at git.blender.org
Wed Apr 1 14:27:38 CEST 2020
Commit: d66519f1972c49a9271cff71aaccf9274b180908
Author: Bastien Montagne
Date: Wed Apr 1 12:33:29 2020 +0200
Branches: master
https://developer.blender.org/rBd66519f1972c49a9271cff71aaccf9274b180908
Writefile: Cleanup CacheFile runtime data.
===================================================================
M source/blender/blenloader/intern/writefile.c
===================================================================
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index c55c3c3404a..254a6f1876e 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3759,6 +3759,12 @@ static void write_linestyle(WriteData *wd, FreestyleLineStyle *linestyle, const
static void write_cachefile(WriteData *wd, CacheFile *cache_file, const void *id_address)
{
if (cache_file->id.us > 0 || wd->use_memfile) {
+ /* Clean up, important in undo case to reduce false detection of changed datablocks. */
+ BLI_listbase_clear(&cache_file->object_paths);
+ cache_file->handle = NULL;
+ memset(cache_file->handle_filepath, 0, sizeof(cache_file->handle_filepath));
+ cache_file->handle_readers = NULL;
+
writestruct_at_address(wd, ID_CF, CacheFile, 1, id_address, cache_file);
if (cache_file->adt) {
More information about the Bf-blender-cvs
mailing list