Browse Source

Report bridge error to server, kill bridge right away if it fails

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.1-rc1
falkTX 5 years ago
parent
commit
c7b5eb2097
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 26 additions and 3 deletions
  1. +16
    -1
      source/backend/engine/CarlaEngineBridge.cpp
  2. +10
    -2
      source/bridges-plugin/CarlaBridgePlugin.cpp

+ 16
- 1
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -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<uint32_t>(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);



+ 10
- 2
source/bridges-plugin/CarlaBridgePlugin.cpp View File

@@ -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
}
}
}



Loading…
Cancel
Save