Browse Source

Fix assertion on empty project path; Change cwd of plugin bridges

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.3.0-RC1
falkTX 4 years ago
parent
commit
605e894b11
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 25 additions and 2 deletions
  1. +2
    -1
      source/backend/engine/CarlaEngine.cpp
  2. +13
    -1
      source/backend/plugin/CarlaPluginBridge.cpp
  3. +10
    -0
      source/modules/water/files/File.cpp

+ 2
- 1
source/backend/engine/CarlaEngine.cpp View File

@@ -1406,7 +1406,8 @@ bool CarlaEngine::saveProject(const char* const filename, const bool setAsCurren
#ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH
const char* CarlaEngine::getCurrentProjectFolder() const noexcept
{
return pData->currentProjectFolder;
return pData->currentProjectFolder.isNotEmpty() ? pData->currentProjectFolder.buffer()
: nullptr;
}

const char* CarlaEngine::getCurrentProjectFilename() const noexcept


+ 13
- 1
source/backend/plugin/CarlaPluginBridge.cpp View File

@@ -320,7 +320,19 @@ protected:
carla_stdout("Starting plugin bridge, command is:\n%s \"%s\" \"%s\" \"%s\" " P_INT64,
fBridgeBinary.toRawUTF8(), getPluginTypeAsString(kPlugin->getType()), filename.toRawUTF8(), fLabel.toRawUTF8(), kPlugin->getUniqueId());

started = fProcess->start(arguments);
const File projFolder(kEngine->getCurrentProjectFolder());

if (projFolder.isNotNull())
{
const File oldFolder(File::getCurrentWorkingDirectory());
projFolder.setAsCurrentWorkingDirectory();
started = fProcess->start(arguments);
oldFolder.setAsCurrentWorkingDirectory();
}
else
{
started = fProcess->start(arguments);
}
}

if (! started)


+ 10
- 0
source/modules/water/files/File.cpp View File

@@ -1109,6 +1109,11 @@ File File::getCurrentWorkingDirectory()
return File (String (dest));
}
bool File::setAsCurrentWorkingDirectory() const
{
return SetCurrentDirectory (getFullPathName().toWideCharPointer()) != FALSE;
}
bool File::isSymbolicLink() const
{
return (GetFileAttributes (fullPath.toUTF8()) & FILE_ATTRIBUTE_REPARSE_POINT) != 0;
@@ -1342,6 +1347,11 @@ File File::getCurrentWorkingDirectory()
return File (CharPointer_UTF8 (cwd));
}
bool File::setAsCurrentWorkingDirectory() const
{
return chdir (getFullPathName().toUTF8()) == 0;
}
File water_getExecutableFile();
File water_getExecutableFile()
{


Loading…
Cancel
Save