diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-15 21:11:15 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-15 21:11:15 +0400 |
commit | e99586fee2eab049e416c0676a8a97604bce20bd (patch) | |
tree | ca1dc2bb146a52c32e3f21f35fe1f3141d25a73a /source | |
parent | f7a38811750237a05baeac58246482d409f0ab83 (diff) |
Fix #37090: Blender crashes on "Make single user" option
issue was caused by id->mewid pointing to an invalid memory
after file load.
The rule here: all the tools need to reset it to NULL (or
other value they need) in the beginning.
Currently some tools are doing newid clear in the beginning
and some does it in the end. We need to clean it up so clear
only happens in the beginning.
But ideal we need some kind NewIDContext to make duplication
safe for threading.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index be4948d8a80..c70a70c47b2 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2211,6 +2211,8 @@ static int make_single_user_exec(bContext *C, wmOperator *op) int flag = RNA_enum_get(op->ptr, "type"); /* 0==ALL, SELECTED==selected objecs */ bool copy_groups = false; + clear_id_newpoins(); + if (RNA_boolean_get(op->ptr, "object")) single_object_users(bmain, scene, v3d, flag, copy_groups); @@ -2227,6 +2229,11 @@ static int make_single_user_exec(bContext *C, wmOperator *op) if (RNA_boolean_get(op->ptr, "animation")) single_object_action_users(scene, flag); + /* TODO(sergey): This should not be needed, however some tool still could rely + * on the fact, that id->newid is kept NULL by default. + * Need to make sure all the guys are learing newid before they're + * using it, not after. + */ clear_id_newpoins(); WM_event_add_notifier(C, NC_WINDOW, NULL); |