diff --git a/source/backend/engine/CarlaEngineBridge.cpp b/source/backend/engine/CarlaEngineBridge.cpp index 176f41220..c83b4c0fb 100644 --- a/source/backend/engine/CarlaEngineBridge.cpp +++ b/source/backend/engine/CarlaEngineBridge.cpp @@ -264,7 +264,22 @@ public: void idle() noexcept override { CarlaPlugin* const plugin(pData->plugins[0].plugin); - CARLA_SAFE_ASSERT_RETURN(plugin != nullptr,); + + if (plugin == nullptr) + { + if (const uint32_t length = static_cast(pData->lastError.length())) + { + const CarlaMutexLocker _cml(fShmNonRtServerControl.mutex); + fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerError); + fShmNonRtServerControl.writeUInt(length); + fShmNonRtServerControl.writeCustomData(pData->lastError.buffer(), length); + fShmNonRtServerControl.commitWrite(); + } + + signalThreadShouldExit(); + callback(true, true, ENGINE_CALLBACK_QUIT, 0, 0, 0, 0, 0.0f, nullptr); + return; + } const bool wasFirstIdle(fFirstIdle); diff --git a/source/bridges-plugin/CarlaBridgePlugin.cpp b/source/bridges-plugin/CarlaBridgePlugin.cpp index 0010069d8..40f87b42e 100644 --- a/source/bridges-plugin/CarlaBridgePlugin.cpp +++ b/source/bridges-plugin/CarlaBridgePlugin.cpp @@ -637,8 +637,16 @@ int main(int argc, char* argv[]) const char* const lastError(carla_get_last_error()); carla_stderr("Plugin failed to load, error was:\n%s", lastError); - //if (useBridge) - // bridge.sendOscBridgeError(lastError); + if (useBridge) + { + // do a single idle so that we can send error message to server + gIdle(); + +#ifdef CARLA_OS_UNIX + // kill ourselves now if we can't load plugin in bridge mode + ::kill(::getpid(), SIGKILL); +#endif + } } }