Don't allow process callback to be invoked between Engine and JACK::Client destruction.

Patch submitted by Peter Nelson. Comments added.
pull/3/head
Jonathan Moore Liles 2010-01-23 10:16:12 -06:00
parent 33e4516589
commit 66daa1e23f
3 changed files with 15 additions and 1 deletions

View File

@ -38,6 +38,10 @@ Engine::Engine ( ) : _thread( "RT" )
Engine::~Engine ( )
{
/* We have to deactivate here in order to avoid our process
callback is being invoked after we're already destroyed, but
before the base class is */
deactivate();
}

View File

@ -34,10 +34,16 @@ namespace JACK
Client::~Client ( )
{
jack_deactivate( _client );
jack_client_close( _client );
}
/** Tell JACK to calling process callback. This MUST be called in
* an inheriting class' destructor */
void
Client::deactivate ( )
{
jack_deactivate( _client );
}
/*******************/

View File

@ -55,6 +55,10 @@ namespace JACK
Client ( const Client &rhs );
Client & operator = ( const Client &rhs );
protected:
void deactivate ( void );
private:
friend class Port;