fix a small memleak.
authorRobin Gareus <robin@gareus.org>
Thu, 10 Sep 2015 15:14:38 +0000 (17:14 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 10 Sep 2015 15:39:31 +0000 (17:39 +0200)
downcase(char*) requires free(), downcase(std::string) does not.

gtk2_ardour/engine_dialog.cc

index 4c70823d0f59540077a149f43fc400d2ec0db188..663702104b88ce1e42e6513ab15e248c2f30a2a8 100644 (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.