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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-03-31 09:36:48 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-03-31 09:36:48 +0300
commit4153ff3610241cc4e4a73326eca49ee2797ee125 (patch)
tree9eea4c9004f7d3448f9ac073093a84d62ea7346a /source/blender/editors/space_outliner
parentc16a8983efba9ecacd8da408d03c37a55483e528 (diff)
Fix T44201: Crash Deleting Hierarchy in Outliner
Typical error using '->next' member of a freed linked list item. A bit trickier even here, since we have some recursion... Trivial fix for nasty crasher, safe for 2.74 imho?
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 64e00589712..fc6717f47be 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -694,23 +694,26 @@ static void outliner_do_data_operation(SpaceOops *soops, int type, int event, Li
}
}
-static void outline_delete_hierarchy(bContext *C, Scene *scene, Base *base)
+static Base *outline_delete_hierarchy(bContext *C, Scene *scene, Base *base)
{
- Base *child_base;
+ Base *child_base, *base_next;
Object *parent;
if (!base) {
- return;
+ return NULL;
}
- for (child_base = scene->base.first; child_base; child_base = child_base->next) {
+ for (child_base = scene->base.first; child_base; child_base = base_next) {
+ base_next = child_base->next;
for (parent = child_base->object->parent; parent && (parent != base->object); parent = parent->parent);
if (parent) {
- outline_delete_hierarchy(C, scene, child_base);
+ base_next = outline_delete_hierarchy(C, scene, child_base);
}
}
+ base_next = base->next;
ED_base_object_free_and_unlink(CTX_data_main(C), scene, base);
+ return base_next;
}
static void object_delete_hierarchy_cb(