[Bf-blender-cvs] [1b4bd1c84e4] blender2.8: Fix T51118: Outliner crash when unlinking collection
Luca Rood
noreply at git.blender.org
Fri Jun 30 12:35:53 CEST 2017
Commit: 1b4bd1c84e404261e267b9cba44fcff20914de6c
Author: Luca Rood
Date: Fri Jun 30 12:32:18 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB1b4bd1c84e404261e267b9cba44fcff20914de6c
Fix T51118: Outliner crash when unlinking collection
The outliner tree was not being rebuilt after unlinking a collection,
and thus a dangling pointer to the collection was kept in the tree.
===================================================================
M source/blender/editors/space_outliner/outliner_collections.c
===================================================================
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index 315a3af1898..2db87df8809 100644
--- a/source/blender/editors/space_outliner/outliner_collections.c
+++ b/source/blender/editors/space_outliner/outliner_collections.c
@@ -216,6 +216,7 @@ static int collection_unlink_poll(bContext *C)
static int collection_unlink_exec(bContext *C, wmOperator *op)
{
LayerCollection *lc = outliner_collection_active(C);
+ SpaceOops *soops = CTX_wm_space_outliner(C);
if (lc == NULL) {
BKE_report(op->reports, RPT_ERROR, "Active element is not a collection");
@@ -225,6 +226,10 @@ static int collection_unlink_exec(bContext *C, wmOperator *op)
SceneLayer *sl = CTX_data_scene_layer(C);
BKE_collection_unlink(sl, lc);
+ if (soops) {
+ outliner_cleanup_tree(soops);
+ }
+
DEG_relations_tag_update(CTX_data_main(C));
/* TODO(sergey): Use proper flag for tagging here. */
More information about the Bf-blender-cvs
mailing list