Blender Git Commit Log

Git Commits -> Revision 3a702ec

Revision 3a702ec by Bastien Montagne (master)
May 22, 2019, 19:10 (GMT)
Fix (unreported) usercount of linked IDs becoming garbage after undo/redo.

Not re-reading linked data-blocks in undo/redo case also means that we
do not touch to their usercounts. Even worse, lib_link process in
readfile will increase those (for cases where local data uses linked
one).

Whole data management code is now heavily relying on valid consistent
refcount of all IDs, so we cannot allow that anymore.

Simple solution here could have been to then not increase that one for
linked IDs in `newlibadr_us()`, but unfortunately that would not be
totally bullet-proof, as some local users of linked data may be added or
removed by an undo step...

So I cannot think of any other solution than the ugly brute force one,
i.e. going over the whole Main database and recompute linked IDs users
count... Should not be a big issue performance wise though, this is
fairly cheap process.

Commit Details:

Full Hash: 3a702ec028231e7deb012edac3eee5ed7f2436d4
Parent Commit: 3600e94
Lines Changed: +9, -0

1 Modified Path:

/source/blender/blenloader/intern/readfile.c (+9, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021