Browse Source

Fix order of track destruction.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
455dc11dc8
7 changed files with 24 additions and 16 deletions
  1. +2
    -2
      Timeline/Annotation_Sequence.H
  2. +2
    -2
      Timeline/Audio_Sequence.C
  3. +0
    -2
      Timeline/Control_Sequence.C
  4. +2
    -6
      Timeline/Engine/Disk_Stream.C
  5. +0
    -2
      Timeline/Engine/Playback_DS.C
  6. +3
    -0
      Timeline/Sequence.C
  7. +15
    -2
      Timeline/Track.C

+ 2
- 2
Timeline/Annotation_Sequence.H View File

@@ -83,9 +83,9 @@ public:

~Annotation_Sequence ( )
{
track()->remove( this );

log_destroy();

track()->remove( this );
}

int handle ( int m )


+ 2
- 2
Timeline/Audio_Sequence.C View File

@@ -49,9 +49,9 @@ Audio_Sequence::Audio_Sequence ( Track *track ) : Sequence( track )

Audio_Sequence::~Audio_Sequence ( )
{
track()->remove( this );

log_destroy();

track()->remove( this );
}




+ 0
- 2
Timeline/Control_Sequence.C View File

@@ -65,8 +65,6 @@ Control_Sequence::~Control_Sequence ( )
delete _output;

_output = NULL;

log_destroy();
}

void


+ 2
- 6
Timeline/Engine/Disk_Stream.C View File

@@ -76,6 +76,8 @@ Disk_Stream::~Disk_Stream ( )

shutdown();

/* FIXME: we must wait on the thread to finish here!!! */

_track = NULL;

sem_destroy( &_blocks );
@@ -136,12 +138,6 @@ Disk_Stream::shutdown ( void )
if ( _thread )
pthread_detach( _thread );

/* we must block until the thread returns, because it might
* still have data left to process in its buffers--and we
* don't want to delete any of the datastructures it's using
* until it finishes with them. */
// pthread_join( _thread, NULL );

_thread = 0;
}



+ 0
- 2
Timeline/Engine/Playback_DS.C View File

@@ -196,8 +196,6 @@ Playback_DS::disk_thread ( void )
#ifndef AVOID_UNNECESSARY_COPYING
delete[] cbuf;
#endif

_terminate = false;
}

/* THREAD: RT */


+ 3
- 0
Timeline/Sequence.C View File

@@ -63,6 +63,9 @@ Sequence::init ( void )

Sequence::~Sequence ( )
{

DMESSAGE( "destroying sequence" );

if ( _name )
free( _name );



+ 15
- 2
Timeline/Track.C View File

@@ -247,6 +247,8 @@ Track::Track ( const char *L, int channels ) :

Track::~Track ( )
{
log_destroy();

timeline->remove_track( this );

/* give up our ports */
@@ -260,8 +262,10 @@ Track::~Track ( )
delete control_out.back();
control_out.pop_back();
}

log_destroy();
_sequence = NULL;
takes = NULL;
control = NULL;
annotation = NULL;

if ( _name )
free( _name );
@@ -355,6 +359,9 @@ Track::add ( Audio_Sequence * t )
void
Track::remove ( Audio_Sequence *t )
{
if ( ! takes )
return;

timeline->wrlock();

takes->remove( t );
@@ -369,6 +376,9 @@ Track::remove ( Audio_Sequence *t )
void
Track::remove ( Annotation_Sequence *t )
{
if ( ! annotation )
return;

annotation->remove( t );

resize();
@@ -377,6 +387,9 @@ Track::remove ( Annotation_Sequence *t )
void
Track::remove ( Control_Sequence *t )
{
if ( ! control )
return;

engine->lock();

control->remove( t );


Loading…
Cancel
Save