Hi,
I am getting very strange exception I don’t understand.
I have foldersCollection object (component), and I can successfully call addFolder inside a loop where I iterate thru my user settings (XmlElements).
My foldersCollection has a callback, and there I use exactly the same loop and want to do some code inside. But! it breaks at the point where I try to call a method of my XmlElement.
auto fxml = getAppProperties().getUserSettings()->getXmlValue("VSTFolders");
if (fxml == nullptr){
getAppProperties().getUserSettings()->getXmlValue("VSTFolders").reset(new XmlElement("folders"));
}
// this works fine:
for (auto *f : fxml->getChildIterator()){
foldersCollection->addFolder(f->getText().toStdString());
}
// if I pass a pointer of Xml, then I get error. Even if I don't pass it, but load settings again...
foldersCollection->onFolderRemoved = [&fxml](std::string path){
const MessageManagerLock l;
// fxml = getAppProperties().getUserSettings()->getXmlValue("VSTFolders"); -- does not help;
for (auto *f : fxml->getChildIterator()){
auto t = f->getAllSubText(); //error = read memory from 0xcccccccccccccccc failed (0 of 8 bytes read)
}
};

