# HG changeset patch # User Chris Cannam # Date 1201172639 0 # Node ID 3a55cd5763343da012bec1b8bd74815f37adce71 # Parent 369a197737c701f95fb553012e27abb8afb9f616 * Further model lifecycle fixes diff -r 369a197737c7 -r 3a55cd576334 layer/SpectrumLayer.cpp --- a/layer/SpectrumLayer.cpp Wed Jan 23 15:43:27 2008 +0000 +++ b/layer/SpectrumLayer.cpp Thu Jan 24 11:03:59 2008 +0000 @@ -63,6 +63,14 @@ m_originModel = model; + if (m_sliceableModel) { + Model *m = const_cast + (static_cast(m_sliceableModel)); + m->aboutToDelete(); + setSliceableModel(0); + delete m; + } + m_newFFTNeeded = true; emit layerParametersChanged(); @@ -646,7 +654,7 @@ { if (!m_originModel || !m_originModel->isOK() || !m_originModel->isReady()) { - std::cerr << "SpectrumLayer::paint: no origin model" << std::endl; + std::cerr << "SpectrumLayer::paint: no origin model, or origin model not OK or not ready" << std::endl; return; }