Mercurial > hg > svcore
comparison data/model/AlignmentModel.cpp @ 1686:e73baeead27f single-point
Model deletion issues - the AlignmentModel doesn't actually need to know about the input aggregate model; the document should own it instead
author | Chris Cannam |
---|---|
date | Thu, 04 Apr 2019 11:15:43 +0100 |
parents | f97d64b8674f |
children | d08b560102a1 |
comparison
equal
deleted
inserted
replaced
1685:0e9840a381b5 | 1686:e73baeead27f |
---|---|
19 | 19 |
20 //#define DEBUG_ALIGNMENT_MODEL 1 | 20 //#define DEBUG_ALIGNMENT_MODEL 1 |
21 | 21 |
22 AlignmentModel::AlignmentModel(Model *reference, | 22 AlignmentModel::AlignmentModel(Model *reference, |
23 Model *aligned, | 23 Model *aligned, |
24 Model *inputModel, | |
25 SparseTimeValueModel *path) : | 24 SparseTimeValueModel *path) : |
26 m_reference(reference), | 25 m_reference(reference), |
27 m_aligned(aligned), | 26 m_aligned(aligned), |
28 m_inputModel(inputModel), | |
29 m_rawPath(path), | 27 m_rawPath(path), |
30 m_path(nullptr), | 28 m_path(nullptr), |
31 m_reversePath(nullptr), | 29 m_reversePath(nullptr), |
32 m_pathBegun(false), | 30 m_pathBegun(false), |
33 m_pathComplete(false) | 31 m_pathComplete(false) |
53 } | 51 } |
54 | 52 |
55 AlignmentModel::~AlignmentModel() | 53 AlignmentModel::~AlignmentModel() |
56 { | 54 { |
57 SVDEBUG << "AlignmentModel(" << this << ")::~AlignmentModel()" << endl; | 55 SVDEBUG << "AlignmentModel(" << this << ")::~AlignmentModel()" << endl; |
58 | |
59 if (m_inputModel) m_inputModel->aboutToDelete(); | |
60 delete m_inputModel; | |
61 | 56 |
62 if (m_rawPath) m_rawPath->aboutToDelete(); | 57 if (m_rawPath) m_rawPath->aboutToDelete(); |
63 delete m_rawPath; | 58 delete m_rawPath; |
64 | 59 |
65 if (m_path) m_path->aboutToDelete(); | 60 if (m_path) m_path->aboutToDelete(); |
212 if (m_pathComplete) { | 207 if (m_pathComplete) { |
213 | 208 |
214 constructPath(); | 209 constructPath(); |
215 constructReversePath(); | 210 constructReversePath(); |
216 | 211 |
217 SVDEBUG << "AlignmentModel: path complete, deleting input" << endl; | 212 SVDEBUG << "AlignmentModel: path complete" << endl; |
218 if (m_inputModel) m_inputModel->aboutToDelete(); | |
219 delete m_inputModel; | |
220 m_inputModel = nullptr; | |
221 } | 213 } |
222 } | 214 } |
223 | 215 |
224 emit completionChanged(); | 216 emit completionChanged(); |
225 } | 217 } |