Browse Source

Fix segfault on close

tags/1.9.4
falkTX 11 years ago
parent
commit
334f0bb027
1 changed files with 10 additions and 26 deletions
  1. +10
    -26
      source/backend/engine/CarlaEngine.cpp

+ 10
- 26
source/backend/engine/CarlaEngine.cpp View File

@@ -985,40 +985,24 @@ bool CarlaEngine::loadProject(const char* const filename)
return false;
}

std::vector<SaveState> saveStates;
QDomNode node(xmlNode.firstChild());

while (! node.isNull())
{
QDomNode node(xmlNode.firstChild());

while (! node.isNull())
if (node.toElement().tagName() == "Plugin")
{
if (node.toElement().tagName() == "Plugin")
const SaveState& saveState = getSaveStateDictFromXML(node);

// TODO - proper find&load plugins
if (addPlugin(getPluginTypeFromString(saveState.type), saveState.binary, saveState.name, saveState.label, nullptr))
{
const SaveState& saveState = getSaveStateDictFromXML(node);
saveStates.push_back(saveState);
if (CarlaPlugin* plugin = getPlugin(kData->curPluginCount-1))
plugin->loadSaveState(saveState);
}

node = node.nextSibling();
}
}

// TODO - proper find&load plugins

for (auto it = saveStates.begin(); it != saveStates.end(); ++it)
{
SaveState& saveState(*it);

if (addPlugin(getPluginTypeFromString(saveState.type), saveState.binary, saveState.name, saveState.label, nullptr))
{
if (CarlaPlugin* plugin = getPlugin(kData->curPluginCount-1))
plugin->loadSaveState(saveState);
}

saveState.reset();
node = node.nextSibling();
}

saveStates.clear();

return true;
}



Loading…
Cancel
Save