diff options
author | Bastien Montagne <bastien@blender.org> | 2022-07-21 17:36:06 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-07-21 17:39:07 +0300 |
commit | b0f9639733500e7c3deedc36c2ef6b9685a756ee (patch) | |
tree | c8f8d992e99b8c8d0458c68be09e71b165a066c3 /source/blender/blenloader/intern/writefile.c | |
parent | 396b7a6ec8fdcc7e8f14ba6694e24093744622f6 (diff) |
Fix crash due to improper handling of new library runtime name_map data on read/write.
Code handling read/write of libraries is still particular... but trying
to call `library_runtime_reset` on a random address at readtime was an
obvious mistake I should have caught during review :(
Regression from rB7f8d05131a77.
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 68171f26a66..1ec056a9f50 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -970,10 +970,15 @@ static void write_libraries(WriteData *wd, Main *main) if (found_one) { /* Not overridable. */ + void *runtime_name_data = main->curlib->runtime.name_map; + main->curlib->runtime.name_map = NULL; + BlendWriter writer = {wd}; writestruct(wd, ID_LI, Library, 1, main->curlib); BKE_id_blend_write(&writer, &main->curlib->id); + main->curlib->runtime.name_map = runtime_name_data; + if (main->curlib->packedfile) { BKE_packedfile_blend_write(&writer, main->curlib->packedfile); if (wd->use_memfile == false) { |