diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-03 22:25:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-03 22:25:43 +0300 |
commit | a7edd5cac50174efd9f5390aa092f569acdb0a39 (patch) | |
tree | 1c671f46616b3a3f527979c8d410ba98d7e0c5da /source/blender | |
parent | f5901517259637a7e6fda4a0897f6c96741796d7 (diff) |
[#20957] Python API: unlink an object while in edit mode may crash Blender
disallow unlinking objects if there not in object mode.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 12415d1c635..90e2b6b6830 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -160,6 +160,11 @@ static void rna_Scene_unlink_object(Scene *scene, bContext *C, ReportList *repor BKE_report(reports, RPT_ERROR, "Object is not in this scene."); return; } + if (base==scene->basact && ob->mode != OB_MODE_OBJECT) { + BKE_report(reports, RPT_ERROR, "Object must be in 'Object Mode' to unlink."); + return; + } + /* as long as ED_base_object_free_and_unlink calls free_libblock_us, we don't have to decrement ob->id.us */ ED_base_object_free_and_unlink(scene, base); |