Destroy sequence contents in sequence destructor.

Destroy loggables in correct order.
This commit is contained in:
Jonathan Moore Liles 2008-05-06 21:00:36 -05:00
parent 1318ba3c3a
commit 42e0e380bd
2 changed files with 24 additions and 5 deletions

View File

@ -84,15 +84,18 @@ 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;
}
}
_log_id = 0;
return true;
}
@ -719,7 +722,10 @@ 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;

View File

@ -59,6 +59,19 @@ Sequence::init ( void )
Sequence::~Sequence ( )
{
/* FIXME: what to do with regions? */
for ( std::list <Sequence_Widget*>::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();