Browse Source

Destroy sequence contents in sequence destructor.

Destroy loggables in correct order.
tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
42e0e380bd
2 changed files with 24 additions and 5 deletions
  1. +11
    -5
      Timeline/Loggable.C
  2. +13
    -0
      Timeline/Sequence.C

+ 11
- 5
Timeline/Loggable.C View File

@@ -84,16 +84,19 @@ Loggable::close ( void )


_fp = NULL; _fp = NULL;


for ( int i = _log_id; i--; )
for ( int i = 0; i < _log_id - 1; ++i )
{ {
Loggable ** l = &_loggables[ i ]; Loggable ** l = &_loggables[ i ];


if ( *l ) if ( *l )
{
delete *l; delete *l;
*l = NULL;
*l = NULL;
}
} }


_log_id = 0;

return true; return true;
} }


@@ -719,10 +722,13 @@ Loggable::log_create ( void ) const
void void
Loggable::log_destroy ( void ) const Loggable::log_destroy ( void ) const
{ {
// indent();
if ( ! _fp )
/* tearing down... don't bother */
return;

log( "%s 0x%X destroy (nothing) << ", class_name(), _id ); log( "%s 0x%X destroy (nothing) << ", class_name(), _id );


char **sa;
char **sa;


Log_Entry e; Log_Entry e;




+ 13
- 0
Timeline/Sequence.C View File

@@ -59,6 +59,19 @@ Sequence::init ( void )
Sequence::~Sequence ( ) Sequence::~Sequence ( )
{ {
/* FIXME: what to do with regions? */ /* 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()->redraw();
parent()->remove( this ); parent()->remove( this );
// log_destroy(); // log_destroy();


Loading…
Cancel
Save