diff --git a/Timeline/Annotation_Sequence.H b/Timeline/Annotation_Sequence.H index 841c705..cb2dcc8 100644 --- a/Timeline/Annotation_Sequence.H +++ b/Timeline/Annotation_Sequence.H @@ -83,9 +83,15 @@ public: ~Annotation_Sequence ( ) { + Loggable::block_start(); + + clear(); + log_destroy(); track()->remove( this ); + + Loggable::block_end(); } int handle ( int m ) diff --git a/Timeline/Audio_Sequence.C b/Timeline/Audio_Sequence.C index 7c2f2e3..0208b75 100644 --- a/Timeline/Audio_Sequence.C +++ b/Timeline/Audio_Sequence.C @@ -49,9 +49,15 @@ Audio_Sequence::Audio_Sequence ( Track *track ) : Sequence( track ) Audio_Sequence::~Audio_Sequence ( ) { + Loggable::block_start(); + + clear(); + log_destroy(); track()->remove( this ); + + Loggable::block_end(); } diff --git a/Timeline/Control_Sequence.C b/Timeline/Control_Sequence.C index a4d91e3..fb7829c 100644 --- a/Timeline/Control_Sequence.C +++ b/Timeline/Control_Sequence.C @@ -52,6 +52,11 @@ Control_Sequence::Control_Sequence ( Track *track ) : Sequence( 0 ) Control_Sequence::~Control_Sequence ( ) { + + Loggable::block_start(); + + clear(); + log_destroy(); engine->lock(); @@ -65,6 +70,8 @@ Control_Sequence::~Control_Sequence ( ) delete _output; _output = NULL; + + Loggable::block_end(); } void diff --git a/Timeline/Sequence.C b/Timeline/Sequence.C index b1a6ba6..da6a6ff 100644 --- a/Timeline/Sequence.C +++ b/Timeline/Sequence.C @@ -61,14 +61,9 @@ Sequence::init ( void ) // clear_visible_focus(); } -Sequence::~Sequence ( ) +void +Sequence::clear ( void ) { - - DMESSAGE( "destroying sequence" ); - - if ( _name ) - free( _name ); - for ( std::list ::iterator i = _widgets.begin(); i != _widgets.end(); ++i ) { @@ -82,6 +77,17 @@ Sequence::~Sequence ( ) _widgets.clear(); } +Sequence::~Sequence ( ) +{ + DMESSAGE( "destroying sequence" ); + + if ( _name ) + free( _name ); + + if ( _widgets.size() ) + FATAL( "programming error: leaf destructor must call Sequence::clear()!" ); +} + nframes_t Sequence::x_to_offset ( int X ) { diff --git a/Timeline/Sequence.H b/Timeline/Sequence.H index 66e9d0b..ae6852a 100644 --- a/Timeline/Sequence.H +++ b/Timeline/Sequence.H @@ -92,6 +92,7 @@ public: } void sort ( void ); + void clear ( void ); nframes_t next ( nframes_t from ) const; nframes_t prev ( nframes_t from ) const; diff --git a/Timeline/Track.C b/Timeline/Track.C index 2b0fc44..47d0ea8 100644 --- a/Timeline/Track.C +++ b/Timeline/Track.C @@ -247,6 +247,14 @@ Track::Track ( const char *L, int channels ) : Track::~Track ( ) { + Loggable::block_start(); + + takes = NULL; + control = NULL; + annotation = NULL; + + Fl_Group::clear(); + log_destroy(); timeline->remove_track( this ); @@ -256,12 +264,11 @@ Track::~Track ( ) configure_outputs( 0 ); _sequence = NULL; - takes = NULL; - control = NULL; - annotation = NULL; if ( _name ) free( _name ); + + Loggable::block_end(); }