Lock mutex when restoring plugin state

This commit is contained in:
xenakios 2017-11-23 17:57:37 +02:00
parent 321e9bbf1c
commit 9207325698

View File

@ -356,9 +356,10 @@ void PaulstretchpluginAudioProcessor::getStateInformation (MemoryBlock& destData
void PaulstretchpluginAudioProcessor::setStateInformation (const void* data, int sizeInBytes) void PaulstretchpluginAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{ {
ValueTree tree = ValueTree::readFromData(data, sizeInBytes); ValueTree tree = ValueTree::readFromData(data, sizeInBytes);
if (tree.isValid()) if (tree.isValid())
{ {
std::lock_guard<std::mutex> locker(m_mutex);
for (int i = 0; i<getNumParameters(); ++i) for (int i = 0; i<getNumParameters(); ++i)
{ {
auto par = getFloatParameter(i); auto par = getFloatParameter(i);