Don't allow process callback to be invoked between Engine and JACK::Client destruction.
Patch submitted by Peter Nelson. Comments added.
This commit is contained in:
parent
33e4516589
commit
66daa1e23f
|
@ -38,6 +38,10 @@ Engine::Engine ( ) : _thread( "RT" )
|
||||||
|
|
||||||
Engine::~Engine ( )
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,10 +34,16 @@ namespace JACK
|
||||||
|
|
||||||
Client::~Client ( )
|
Client::~Client ( )
|
||||||
{
|
{
|
||||||
jack_deactivate( _client );
|
|
||||||
jack_client_close( _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 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************/
|
/*******************/
|
||||||
|
|
|
@ -55,6 +55,10 @@ namespace JACK
|
||||||
Client ( const Client &rhs );
|
Client ( const Client &rhs );
|
||||||
Client & operator = ( const Client &rhs );
|
Client & operator = ( const Client &rhs );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
void deactivate ( void );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
friend class Port;
|
friend class Port;
|
||||||
|
|
Loading…
Reference in New Issue