Blender Git Commit Log

Git Commits -> Revision 0e3d1ee

Revision 0e3d1ee by Bastien Montagne (master)
February 8, 2019, 17:54 (GMT)
Fix (unreported) crash when undoing after ID deletion.

Yes, we do can undo an ID deletion now.

However, this requires extra care in UI 'remapping' to new IDs step
(when undoing, we do not fully reload the UI from saved .blend).
Otherwise, new UI (i.e. one from saved .blend file) might reference
IDs that where freed in old bmain (the one before the undo), we cannot
use those to get ID name then, that would be a nasty use-after-free!

To prevent this, we generate a GSet of all valid ID pointers at that
time (i.e. those found in both old and new Main's), and ensure any ID
we try to remap by its name is in that GSet. Otherwise, there is no
possible remapping, just return NULL.

Commit Details:

Full Hash: 0e3d1eee15b7b6dadaddaa7f1f4b8d30b80e6792
Parent Commit: 6ba8e71
Lines Changed: +46, -8

5 Modified Paths:

/source/blender/blenkernel/BKE_library_idmap.h (+4, -2) (Diff)
/source/blender/blenkernel/intern/blendfile.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/library_idmap.c (+38, -2) (Diff)
/source/blender/blenloader/BLO_readfile.h (+1, -1) (Diff)
/source/blender/blenloader/intern/readfile.c (+2, -2) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021