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); allqueue(REDRAWALL, 0);
} }
// really bad, doesnt do constraints, that has been coded in test_scene_constraints();
void free_and_unlink_base(Base *base) void free_and_unlink_base(Base *base)
{ {
if (base==BASACT) if (base==BASACT)
@@ -287,7 +288,8 @@ void delete_obj(int ok)
if(islamp && G.vd->drawtype==OB_SHADED) reshadeall_displist(); if(islamp && G.vd->drawtype==OB_SHADED) reshadeall_displist();
test_scene_constraints(); test_scene_constraints(); // do because of delete obj
allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWVIEW3D, 0);
redraw_test_buttons(OBACT); redraw_test_buttons(OBACT);
allqueue (REDRAWACTION, 0); allqueue (REDRAWACTION, 0);
@@ -2272,6 +2274,9 @@ void convertmenu(void)
free_and_unlink_base(basedel); free_and_unlink_base(basedel);
basedel = NULL; basedel = NULL;
} }
test_scene_constraints(); // always call after delete object
countall(); countall();
allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWOOPS, 0); allqueue(REDRAWOOPS, 0);

View File

@@ -432,6 +432,8 @@ void join_mesh(void)
enter_editmode(); enter_editmode();
exit_editmode(1); // freedata, but no undo exit_editmode(1); // freedata, but no undo
test_scene_constraints(); // always call after delete object (stupid!)
allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSSHADING, 0); allqueue(REDRAWBUTSSHADING, 0);
makeDispList(ob); makeDispList(ob);