diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-01-18 10:04:08 +0300 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-01-18 10:04:08 +0300 |
commit | 21f431047f3ac18ddf2d71f11d2fbc3aa7bd38b4 (patch) | |
tree | bebf37aa739a74c47e08780c70d6f6cc6f04799f | |
parent | 33e43911369b7cd8a7d0342cb20feeb3cb8d28ff (diff) |
Fixed bug #5742, Crash on sculpt mode. This bug was triggered when adding a new object while already in sculpt mode. Sculpt mode wasn't being deactived on cameras, lamps, etc. Fixed in add_object_draw() by turning off G_SCULPTMODE, also by adding a check in sculpt_init_session() to be sure any previous session is free'd before making a new one.
-rw-r--r-- | source/blender/src/editobject.c | 2 | ||||
-rw-r--r-- | source/blender/src/sculptmode.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 3c44c9b7a6d..f9389b45d38 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -186,7 +186,7 @@ void add_object_draw(int type) /* for toolbox or menus, only non-editmode stuff { Object *ob; - G.f &= ~(G_VERTEXPAINT+G_FACESELECT+G_TEXTUREPAINT+G_WEIGHTPAINT); + G.f &= ~(G_VERTEXPAINT+G_FACESELECT+G_TEXTUREPAINT+G_WEIGHTPAINT+G_SCULPTMODE); setcursor_space(SPACE_VIEW3D, CURSOR_STD); if ELEM3(curarea->spacetype, SPACE_VIEW3D, SPACE_BUTS, SPACE_INFO) { diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c index f2acdd111e0..b0559b8fbe7 100644 --- a/source/blender/src/sculptmode.c +++ b/source/blender/src/sculptmode.c @@ -211,8 +211,11 @@ void sculptmode_init(Scene *sce) } void sculptmode_undo_init(); +void sculptmode_free_session(Scene *); void sculpt_init_session() { + if(sculpt_data()->session) + sculptmode_free_session(G.scene); sculpt_data()->session= MEM_callocN(sizeof(SculptSession), "SculptSession"); sculptmode_undo_init(); } |