From 1f284bb583ddf70693c8c088fdae22dd3bbd1fd2 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 12 Mar 2005 12:10:07 +0000 Subject: [PATCH] Bug fix as reported by Fish-Face/Chris Le Sueur on IRC After deleting an object, the call free_and_unlink_base() takes care of NULLifying object pointers. But, with exception of constraints. Silly!!! So, in the end of a function additionally the test_scene_constraints() has to be called to prevent crashes. This was missing in join_mesh and convert_object. --- source/blender/src/editobject.c | 7 ++++++- source/blender/src/meshtools.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 1d2267db4fb..4719402e06d 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -248,6 +248,7 @@ void add_objectLamp(short type) allqueue(REDRAWALL, 0); } +// really bad, doesnt do constraints, that has been coded in test_scene_constraints(); void free_and_unlink_base(Base *base) { if (base==BASACT) @@ -287,7 +288,8 @@ void delete_obj(int ok) if(islamp && G.vd->drawtype==OB_SHADED) reshadeall_displist(); - test_scene_constraints(); + test_scene_constraints(); // do because of delete obj + allqueue(REDRAWVIEW3D, 0); redraw_test_buttons(OBACT); allqueue (REDRAWACTION, 0); @@ -2272,6 +2274,9 @@ void convertmenu(void) free_and_unlink_base(basedel); basedel = NULL; } + + test_scene_constraints(); // always call after delete object + countall(); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWOOPS, 0); diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c index 70f806adb8d..f0f3fe018a6 100644 --- a/source/blender/src/meshtools.c +++ b/source/blender/src/meshtools.c @@ -432,6 +432,8 @@ void join_mesh(void) enter_editmode(); exit_editmode(1); // freedata, but no undo + test_scene_constraints(); // always call after delete object (stupid!) + allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWBUTSSHADING, 0); makeDispList(ob);