diff --git a/Timeline/Loggable.C b/Timeline/Loggable.C index 5829e04..c9e3bfd 100644 --- a/Timeline/Loggable.C +++ b/Timeline/Loggable.C @@ -84,16 +84,19 @@ Loggable::close ( void ) _fp = NULL; - for ( int i = _log_id; i--; ) + for ( int i = 0; i < _log_id - 1; ++i ) { Loggable ** l = &_loggables[ i ]; if ( *l ) + { delete *l; - - *l = NULL; + *l = NULL; + } } + _log_id = 0; + return true; } @@ -719,10 +722,13 @@ Loggable::log_create ( void ) const void Loggable::log_destroy ( void ) const { -// indent(); + if ( ! _fp ) + /* tearing down... don't bother */ + return; + log( "%s 0x%X destroy (nothing) << ", class_name(), _id ); - char **sa; + char **sa; Log_Entry e; diff --git a/Timeline/Sequence.C b/Timeline/Sequence.C index 41f40a6..a33fbb7 100644 --- a/Timeline/Sequence.C +++ b/Timeline/Sequence.C @@ -59,6 +59,19 @@ Sequence::init ( void ) Sequence::~Sequence ( ) { /* FIXME: what to do with regions? */ + + for ( std::list ::iterator i = _widgets.begin(); + i != _widgets.end(); ++i ) + { + Sequence_Widget *w = *i; + + *i = NULL; + + delete w; + } + + _widgets.clear(); + parent()->redraw(); parent()->remove( this ); // log_destroy();