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 <montagne29@wanadoo.fr>2020-01-28 18:10:37 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2020-01-28 18:10:37 +0300
commit38f3a85649088119436a89161fadf7e217b8b040 (patch)
tree5a6c1f69242718145afb6cfa0929839fc1c1e750 /source/blender/blenloader
parent7038a3a774cab845300e32745acb4439eb913b55 (diff)
parent864cb7f376816ccd05e6e143dab668329b070faa (diff)
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d9d89592e85..5a834f31528 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9318,6 +9318,9 @@ static BHead *read_libblock(FileData *fd,
ID *id;
ListBase *lb;
const char *allocname;
+
+ /* XXX Very weakly handled currently, see comment at the end of this function before trying to
+ * use it for anything new. */
bool wrong_id = false;
/* In undo case, most libs and linked data should be kept as is from previous state
@@ -9573,7 +9576,14 @@ static BHead *read_libblock(FileData *fd,
oldnewmap_clear(fd->datamap);
if (wrong_id) {
+ /* XXX This is probably working OK currently given the very limited scope of that flag.
+ * However, it is absolutely **not** handled correctly: it is freeing an ID pointer that has
+ * been added to the fd->libmap mapping, which in theory could lead to nice crashes...
+ * This should be properly solved at some point. */
BKE_id_free(main, id);
+ if (r_id != NULL) {
+ *r_id = NULL;
+ }
}
return (bhead);