diff --git a/Timeline/Engine/Engine.C b/Timeline/Engine/Engine.C index 00c49c6..323c734 100644 --- a/Timeline/Engine/Engine.C +++ b/Timeline/Engine/Engine.C @@ -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(); } diff --git a/nonlib/JACK/Client.C b/nonlib/JACK/Client.C index b9b41ae..08df27f 100644 --- a/nonlib/JACK/Client.C +++ b/nonlib/JACK/Client.C @@ -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 ); + } /*******************/ diff --git a/nonlib/JACK/Client.H b/nonlib/JACK/Client.H index 53ff47b..e3b0c60 100644 --- a/nonlib/JACK/Client.H +++ b/nonlib/JACK/Client.H @@ -55,6 +55,10 @@ namespace JACK Client ( const Client &rhs ); Client & operator = ( const Client &rhs ); + protected: + + void deactivate ( void ); + private: friend class Port;