From 6a52d19611a0353ba707db29808e4cf66e9e7b0a Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 18 Mar 2013 00:42:12 +0000 Subject: [PATCH] Test build for crash on zyn UI close --- source/bridges/CarlaBridgePlugin.cpp | 43 ++++++++++++++++++++++++++++ source/bridges/Makefile | 2 ++ 2 files changed, 45 insertions(+) diff --git a/source/bridges/CarlaBridgePlugin.cpp b/source/bridges/CarlaBridgePlugin.cpp index 6c0f92909..312a2f869 100644 --- a/source/bridges/CarlaBridgePlugin.cpp +++ b/source/bridges/CarlaBridgePlugin.cpp @@ -337,7 +337,17 @@ protected: { case CALLBACK_SHOW_GUI: if (value1 != 1 && ! isOscControlRegistered()) +#if 1 + { + static int count = 0; + count++; + + if (count == 2) + gCloseNow = true; + } +#else gCloseNow = true; +#endif break; default: break; @@ -473,6 +483,38 @@ int main(int argc, char* argv[]) { CARLA_BRIDGE_USE_NAMESPACE +#if 1 + QApplication app(argc, argv, true); + app.setQuitOnLastWindowClosed(false); + + // Init Plugin client + CarlaPluginClient client("zyn-2-test"); + + // Listen for ctrl+c or sigint/sigterm events + initSignalHandler(); + + if (!carla_add_plugin(CarlaBackend::BINARY_NATIVE, CarlaBackend::PLUGIN_INTERNAL, nullptr, "zyn1", "zynaddsubfx", nullptr)) + { + carla_stderr(carla_get_last_error()); + return 1; + } + + carla_add_plugin(CarlaBackend::BINARY_NATIVE, CarlaBackend::PLUGIN_INTERNAL, nullptr, "zyn2", "zynaddsubfx", nullptr); + + carla_set_active(0, true); + carla_set_active(1, true); + carla_show_gui(0, true); + carla_show_gui(1, true); + + client.ready(); + + app.exec(); + + carla_remove_plugin(1); + carla_remove_plugin(0); + + return 0; +#else if (argc != 6) { carla_stdout("usage: %s