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:
Devin J. Pohly
2013-08-26 08:40:52 -04:00
parent 7b7dfda3bc
commit 3527ad1ab8
+9 -1
View File
@@ -17,7 +17,14 @@ 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);
}
@@ -99,6 +106,7 @@ out_unreg_l:
jack_port_unregister(client, port_l);
out_close:
jack_client_close(client);
client = NULL;
return error;
}