diff align/Align.cpp @ 773:699b5b130ea2 pitch-align

Fixes to aligner destruction sequence when re-aligning during alignment; hide debug output behind a flag
author Chris Cannam
date Mon, 01 Jun 2020 17:13:09 +0100
parents 1d6cca5a5621
children 32e66fcc4cb7
line wrap: on
line diff
--- a/align/Align.cpp	Mon Jun 01 17:12:12 2020 +0100
+++ b/align/Align.cpp	Mon Jun 01 17:13:09 2020 +0100
@@ -102,6 +102,14 @@
     
     std::shared_ptr<Aligner> aligner;
 
+    if (m_aligners.find(toAlign) != m_aligners.end()) {
+        // We don't want a callback on removeAligner to happen during
+        // our own call to addAligner! Disconnect and delete the old
+        // aligner first
+        disconnect(m_aligners[toAlign].get(), nullptr, this, nullptr);
+        m_aligners.erase(toAlign);
+    }
+    
     {
         // Replace the aligner with a new one. This also stops any
         // previously-running alignment, when the old entry is