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:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-09-02 17:23:44 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-09-02 17:23:44 +0400
commit6b4bdf621f2830ceff2c44f871523a312422a338 (patch)
tree611cce5a696d73f74124df6e3261724cd4e50bbf /source/blender/editors/space_outliner/outliner_tools.c
parent3386563368f1e489a40e86671933af385e4073f9 (diff)
Fix #28467: Crash while deleting objects in outliner too fast
Cleanup tree when handling object delete from outliner. Prevents handling the same tree item twice when clicking fast.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tools.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 70dfbfe3830..b3170f9cd1e 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -287,6 +287,8 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto
if(base==NULL)
base= object_in_scene((Object *)tselem->id, scene);
if(base) {
+ SpaceOops *soops= CTX_wm_space_outliner(C);
+
// check also library later
if(scene->obedit==base->object)
ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR|EM_DO_UNDO);
@@ -294,6 +296,13 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto
ED_base_object_free_and_unlink(CTX_data_main(C), scene, base);
te->directdata= NULL;
tselem->id= NULL;
+
+ /* XXX: tree management normally happens from draw_outliner(), but when
+ you're clicking to fast on Delete object from context menu in
+ outliner several mouse events can be handled in one cycle without
+ handling notifiers/redraw which leads to deleting the same object twice.
+ cleanup tree here to prevent such cases. */
+ outliner_cleanup_tree(soops);
}
}