Properly handle removal of a track's active sequence.

This commit is contained in:
Jonathan Moore Liles 2008-07-31 23:18:43 -05:00
parent d84383c704
commit b25c206ceb
2 changed files with 15 additions and 1 deletions

View File

@ -78,6 +78,9 @@ Sequence::~Sequence ( )
if ( _widgets.size() )
FATAL( "programming error: leaf destructor must call Sequence::clear()!" );
if ( parent() )
parent()->remove( this );
}

View File

@ -490,7 +490,18 @@ Track::remove ( Audio_Sequence *t )
timeline->wrlock();
takes->remove( t );
if ( sequence() == t )
{
pack->remove( t );
if ( takes->children() )
sequence( (Audio_Sequence*)takes->child( 0 ) );
else
/* FIXME: should this ever happen? */
_sequence = NULL;
}
else
takes->remove( t );
/* delete t; */