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.
This commit is contained in:
2005-03-12 12:10:07 +00:00
parent e1e6b10488
commit 1f284bb583
2 changed files with 8 additions and 1 deletions

View File

@@ -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);