JACK: let Init do the cleanup on failure
Previously, if Init failed, we were calling jack_client_close twice and segfaulting.
This commit is contained in:
@@ -17,7 +17,14 @@ RageSoundDriver_JACK::RageSoundDriver_JACK() :
|
|||||||
|
|
||||||
RageSoundDriver_JACK::~RageSoundDriver_JACK()
|
RageSoundDriver_JACK::~RageSoundDriver_JACK()
|
||||||
{
|
{
|
||||||
// Shut down client
|
// If Init failed, it cleaned up already and set client to NULL
|
||||||
|
if (client == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Clean up and shut down client
|
||||||
|
jack_deactivate(client);
|
||||||
|
jack_port_unregister(client, port_r);
|
||||||
|
jack_port_unregister(client, port_l);
|
||||||
jack_client_close(client);
|
jack_client_close(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,6 +106,7 @@ out_unreg_l:
|
|||||||
jack_port_unregister(client, port_l);
|
jack_port_unregister(client, port_l);
|
||||||
out_close:
|
out_close:
|
||||||
jack_client_close(client);
|
jack_client_close(client);
|
||||||
|
client = NULL;
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user