# HG changeset patch # User Chris Cannam # Date 1396512273 -3600 # Node ID 8eb167e817e7b8b707d3a49a713f9276d906a378 # Parent 577101c9fdb76da0c725b64522fb76fc49607777 Remove any pitch candidate layers and selections before saving session diff -r 577101c9fdb7 -r 8eb167e817e7 src/Analyser.cpp --- a/src/Analyser.cpp Thu Apr 03 08:51:30 2014 +0100 +++ b/src/Analyser.cpp Thu Apr 03 09:04:33 2014 +0100 @@ -605,6 +605,12 @@ } void +Analyser::clearReAnalysis() +{ + discardPitchCandidates(); +} + +void Analyser::discardPitchCandidates() { if (!m_reAnalysisCandidates.empty()) { diff -r 577101c9fdb7 -r 8eb167e817e7 src/Analyser.h --- a/src/Analyser.h Thu Apr 03 08:51:30 2014 +0100 +++ b/src/Analyser.h Thu Apr 03 09:04:33 2014 +0100 @@ -180,6 +180,14 @@ void abandonReAnalysis(Selection sel); /** + * Remove any re-analysis layers, without any expectation of + * adding them later, unlike showPitchCandidates(false), and + * without changing the current pitch track, unlike + * abandonReAnalysis(). + */ + void clearReAnalysis(); + + /** * Import the pitch track from the given layer into our * pitch-track layer. */ diff -r 577101c9fdb7 -r 8eb167e817e7 src/MainWindow.cpp --- a/src/MainWindow.cpp Thu Apr 03 08:51:30 2014 +0100 +++ b/src/MainWindow.cpp Thu Apr 03 09:04:33 2014 +0100 @@ -1685,6 +1685,11 @@ void MainWindow::saveSession() { + // We do not want to save mid-analysis regions -- that would cause + // confusion on reloading + m_analyser->clearReAnalysis(); + clearSelection(); + if (m_sessionFile != "") { if (!saveSessionFile(m_sessionFile)) { QMessageBox::critical