diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-04-01 13:33:29 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-04-01 13:39:06 +0300 |
commit | d66519f1972c49a9271cff71aaccf9274b180908 (patch) | |
tree | cf395b9ad3c4a5da78a36e3ddd1570c128c5891f | |
parent | d31f79a9bc6aff3c3f372e2eabbb50e07bc74193 (diff) |
Writefile: Cleanup CacheFile runtime data.
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 6 |
1 files changed, 6 insertions, 0 deletions
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) { |