Fix memory leak.

Spotted by Scott.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg210447.html
This commit is contained in:
Pavel Sanda 2020-02-18 10:03:42 +01:00
parent fc790bc1f5
commit b7af21ad7c
2 changed files with 8 additions and 0 deletions

View File

@ -336,6 +336,13 @@ void TocModels::updateItem(QString const & type, DocIterator const & dit)
models_[type]->updateItem(dit);
}
TocModels::~TocModels(){
QHashIterator<QString, TocModel *> iter(models_);
while(iter.hasNext()) {
iter.next();
delete iter.value();
}
}
void TocModels::reset(BufferView const * bv)
{

View File

@ -113,6 +113,7 @@ class TocModels : public QObject
public:
///
TocModels();
~TocModels();
///
void reset(BufferView const * bv);
///