AudioGraph add connection causes plugin crash


I use an AudioGraph class in my audio plugin, everything works fine, but sometime when I add a new connection plugin crash. It looks like a thread problem. However I use Lock, so I do not know, where would be a mistake.

addStereoConnection(uint32 sourceModuleID, uint32 destModuleID) {
  ScopedLock myLock(processor.getCallbackLock());
  graph.addConnection(sourceModuleID, 0, destModuleID, 0);
  graph.addConnection(sourceModuleID, 1, destModuleID, 1);

Thank you


The AudioGraph is also an AudioProcessor in itself. So you also need to lock the AudioGraph’s callback lock.