13
0

fix a small memleak.

downcase(char*) requires free(), downcase(std::string) does not.
This commit is contained in:
Robin Gareus 2015-09-10 17:14:38 +02:00
parent 1ebe22eeed
commit b7fbd4e9c0

View File

@ -951,7 +951,7 @@ EngineControl::backend_changed ()
string backend_name = backend_combo.get_active_text();
boost::shared_ptr<ARDOUR::AudioBackend> backend;
if (!(backend = ARDOUR::AudioEngine::instance()->set_backend (backend_name, downcase (PROGRAM_NAME), ""))) {
if (!(backend = ARDOUR::AudioEngine::instance()->set_backend (backend_name, downcase (std::string(PROGRAM_NAME)), ""))) {
/* eh? setting the backend failed... how ? */
/* A: stale config contains a backend that does not exist in current build */
return;
@ -1978,7 +1978,7 @@ EngineControl::set_current_state (const State& state)
boost::shared_ptr<ARDOUR::AudioBackend> backend;
if (!(backend = ARDOUR::AudioEngine::instance ()->set_backend (
state->backend, downcase (PROGRAM_NAME), ""))) {
state->backend, downcase (std::string(PROGRAM_NAME)), ""))) {
DEBUG_ECONTROL (string_compose ("Unable to set backend to %1", state->backend));
// this shouldn't happen as the invalid backend names should have been
// removed from the list of states.