comparison data/model/Model.cpp @ 360:ac300d385ab2

* Various fixes to object lifetime management, particularly in the spectrum layer and for notification of main model deletion. The main purpose of this is to improve the behaviour of the spectrum, but I think it may also help with #1840922 Various crashes in Layer Summary window.
author Chris Cannam
date Wed, 23 Jan 2008 15:43:27 +0000
parents 700cd3350391
children d77e1fa49e26
comparison
equal deleted inserted replaced
359:824ee993ca8d 360:ac300d385ab2
23 23
24 const int Model::COMPLETION_UNKNOWN = -1; 24 const int Model::COMPLETION_UNKNOWN = -1;
25 25
26 Model::~Model() 26 Model::~Model()
27 { 27 {
28 // std::cerr << "Model::~Model(" << this << ")" << std::endl; 28 std::cerr << "Model::~Model(" << this << ")" << std::endl;
29 29
30 if (!m_aboutToDelete) { 30 if (!m_aboutToDelete) {
31 std::cerr << "NOTE: Model::~Model(" << this << ", \"" 31 std::cerr << "NOTE: Model::~Model(" << this << ", \""
32 << objectName().toStdString() << "\"): Model deleted " 32 << objectName().toStdString() << "\"): Model deleted "
33 << "with no aboutToDelete notification" << std::endl; 33 << "with no aboutToDelete notification" << std::endl;
64 } 64 }
65 65
66 void 66 void
67 Model::aboutToDelete() 67 Model::aboutToDelete()
68 { 68 {
69 std::cerr << "Model(" << this << ")::aboutToDelete()" << std::endl;
70
69 if (m_aboutToDelete) { 71 if (m_aboutToDelete) {
70 std::cerr << "WARNING: Model(" << this << ", \"" 72 std::cerr << "WARNING: Model(" << this << ", \""
71 << objectName().toStdString() << "\")::aboutToDelete: " 73 << objectName().toStdString() << "\")::aboutToDelete: "
72 << "aboutToDelete called more than once for the same model" 74 << "aboutToDelete called more than once for the same model"
73 << std::endl; 75 << std::endl;