Blender Git Loki

Git Commits -> Revision f271d85

Revision f271d85 by Bastien Montagne (master)
April 30, 2015, 12:28 (GMT)
Fix T44439: outliner's treestore could keep invalid ID pointers, could crash on undo due to invalid mem access.

We cannot nuke treestore in readfile's `blo_lib_link_screen_restore()`, because this will
destroy all UI-state data (like opened/closed items, etc.).

Since we cannot know for sure whether an ID pointer from tselem->id is valid here, we
have to ensure they are never invalid, i.e. to always set them to NULL when we delete them.

To do so, this commit uses a similar approach as what already exists for ID references
in WM notifiers - it extends `free_notifier_reference_cb()` to also nullify those IDs in
all outliners.

Note that some ID types are not used(shown) by outliner currently, so `TREESTORE_ID_TYPE` macro
was added, that checks whether an ID is possibly used by outliner. Avoids a few searches
in whole tree whene deleting some IDs.

Reviewers: campbellbarton, sergey

Maniphest Tasks: T44439

Differential Revision: https://developer.blender.org/D1272

Commit Details:

Full Hash: f271d85b865cb5e82b50a29f91d2cabbbede6a9a
Parent Commit: d1c9852
Lines Changed: +100, -0

1 Added Path:

/source/blender/editors/include/ED_outliner.h (+36, -0) (View)

4 Modified Paths:

/source/blender/editors/space_outliner/outliner_edit.c (+36, -0) (Diff)
/source/blender/editors/space_outliner/outliner_intern.h (+4, -0) (Diff)
/source/blender/editors/space_outliner/outliner_tree.c (+5, -0) (Diff)
/source/blender/windowmanager/intern/wm_event_system.c (+19, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021