Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <b.mont29@gmail.com>2020-04-01 13:33:29 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-04-01 13:39:06 +0300
commitd66519f1972c49a9271cff71aaccf9274b180908 (patch)
treecf395b9ad3c4a5da78a36e3ddd1570c128c5891f /source/blender
parentd31f79a9bc6aff3c3f372e2eabbb50e07bc74193 (diff)
Writefile: Cleanup CacheFile runtime data.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenloader/intern/writefile.c6
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) {