diff data/model/FFTModel.cpp @ 384:6f6ab834449d spectrogram-cache-rejig

* Merge from trunk
author Chris Cannam
date Wed, 27 Feb 2008 11:59:42 +0000
parents aa8dbac62024
children
line wrap: on
line diff
--- a/data/model/FFTModel.cpp	Thu Nov 15 14:03:56 2007 +0000
+++ b/data/model/FFTModel.cpp	Wed Feb 27 11:59:42 2008 +0000
@@ -82,6 +82,19 @@
     if (m_server) FFTDataServer::releaseInstance(m_server);
 }
 
+void
+FFTModel::sourceModelAboutToBeDeleted()
+{
+    if (m_sourceModel) {
+        std::cerr << "FFTModel[" << this << "]::sourceModelAboutToBeDeleted(" << m_sourceModel << ")" << std::endl;
+        if (m_server) {
+            FFTDataServer::releaseInstance(m_server);
+            m_server = 0;
+        }
+        FFTDataServer::modelAboutToBeDeleted(m_sourceModel);
+    }
+}
+
 FFTDataServer *
 FFTModel::getServer(const DenseTimeValueModel *model,
                     int channel,