Mercurial > hg > svgui
diff layer/Colour3DPlotLayer.cpp @ 1242:b10bd0611d16
Fix various "model deleted with no aboutToDelete notification" warnings (and one associated potential memory leak)
author | Chris Cannam |
---|---|
date | Wed, 22 Feb 2017 12:01:39 +0000 |
parents | 4d0ca1ab4cd0 |
children | 3ec95b7d1bfc |
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp Wed Feb 22 09:53:58 2017 +0000 +++ b/layer/Colour3DPlotLayer.cpp Wed Feb 22 12:01:39 2017 +0000 @@ -70,6 +70,7 @@ Colour3DPlotLayer::~Colour3DPlotLayer() { invalidateRenderers(); + if (m_peakCache) m_peakCache->aboutToDelete(); delete m_peakCache; } @@ -135,6 +136,8 @@ void Colour3DPlotLayer::setModel(const DenseThreeDimensionalModel *model) { + SVDEBUG << "Colour3DPlotLayer::setModel(" << model << ")" << endl; + if (m_model == model) return; const DenseThreeDimensionalModel *oldModel = m_model; m_model = model; @@ -155,6 +158,7 @@ m_peakResolution = 128; } + if (m_peakCache) m_peakCache->aboutToDelete(); delete m_peakCache; m_peakCache = 0; @@ -177,6 +181,7 @@ sv_frame_t /* endFrame */) { //!!! should do this only if the range is visible + if (m_peakCache) m_peakCache->aboutToDelete(); delete m_peakCache; m_peakCache = 0;