This modification removes a bone's

action channel from the cooresponding
action when the bone's IPO is deleted
from the IPO window (the old behavior
was to set the channel's ipo to NULL
without removing it from the action).
This is to alleviate the problem that
there is a lot of action channel code
that tries to access the channel's ipo
(chan->ipo) without testing whether
it is NULL or not (resulting in a
segfault).

This seems to be the best way to
solve this problem ... unless there
is a reason why it might be useful
to have an action channel with no
ipo attached to it?

Thanks to zel365 for uncovering this
problem.
This commit is contained in:
Chris Want 2003-02-13 23:30:51 +00:00
parent 8729dfb134
commit 76396efb14

@ -1038,7 +1038,13 @@ void do_global_buttons(unsigned short event)
else if(ipo->blocktype==ID_WO) ( (World *)from)->ipo= 0;
else if(ipo->blocktype==ID_CA) ( (Camera *)from)->ipo= 0;
else if(ipo->blocktype==ID_SO) ( (bSound *)from)->ipo= 0;
else if(ipo->blocktype==ID_AC) get_hilighted_action_channel((bAction*)from)->ipo= 0;
else if(ipo->blocktype==ID_AC) {
bAction *act = (bAction*) from;
bActionChannel *chan =
get_hilighted_action_channel((bAction*)from);
chan->ipo->id.us--;
BLI_freelinkN (&act->chanbase, chan);
}
else if(ipo->blocktype==IPO_CO) ((Object *)from)->activecon->ipo= 0;
else error("Warn bugs@blender.nl!");