From b25c206cebcb6a351e9b6d6943bef037efd99a17 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Thu, 31 Jul 2008 23:18:43 -0500 Subject: [PATCH] Properly handle removal of a track's active sequence. --- Timeline/Sequence.C | 3 +++ Timeline/Track.C | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Timeline/Sequence.C b/Timeline/Sequence.C index 2636554..8c7c082 100644 --- a/Timeline/Sequence.C +++ b/Timeline/Sequence.C @@ -78,6 +78,9 @@ Sequence::~Sequence ( ) if ( _widgets.size() ) FATAL( "programming error: leaf destructor must call Sequence::clear()!" ); + + if ( parent() ) + parent()->remove( this ); } diff --git a/Timeline/Track.C b/Timeline/Track.C index 662d3a9..b2f334f 100644 --- a/Timeline/Track.C +++ b/Timeline/Track.C @@ -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; */