Don't allow recursive calls to EngineDialog
authorRobin Gareus <robin@gareus.org>
Sat, 19 Nov 2016 03:54:36 +0000 (04:54 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 19 Nov 2016 03:54:36 +0000 (04:54 +0100)
OK -> start_engine() can eg. trigger an interactive plugin scan,
which in turn leaves the EngineDialog responsive. changing settings
or clicking OK again can lead to undefined behavior.

gtk2_ardour/engine_dialog.cc

index 8a6c42fd8c79bdb11771d4463dcfe96322fa65b3..b20b56176fc5a3568a080b9c1b761126e41d398e 100644 (file)
@@ -466,10 +466,10 @@ EngineControl::on_response (int response_id)
 
        switch (response_id) {
        case RESPONSE_OK:
+               hide();
                if (!start_engine()) {
+                       show();
                        return;
-               } else {
-                       hide();
                }
 #ifdef PLATFORM_WINDOWS