From f326b14604048b26722966add5d49bf02aa9db4c Mon Sep 17 00:00:00 2001 From: cc9cii Date: Tue, 21 Apr 2015 10:25:19 +1000 Subject: [PATCH] Allow Qt to cleanup its signals. --- apps/opencs/model/doc/documentmanager.cpp | 2 +- apps/opencs/view/doc/view.cpp | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/opencs/model/doc/documentmanager.cpp b/apps/opencs/model/doc/documentmanager.cpp index 7a1a86153..2d444f245 100644 --- a/apps/opencs/model/doc/documentmanager.cpp +++ b/apps/opencs/model/doc/documentmanager.cpp @@ -69,7 +69,7 @@ void CSMDoc::DocumentManager::removeDocument (CSMDoc::Document *document) throw std::runtime_error ("removing invalid document"); mDocuments.erase (iter); - delete document; + document->deleteLater(); if (mDocuments.empty()) emit lastDocumentDeleted(); diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index aaf8f2d6a..e430bfa5e 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -32,10 +32,6 @@ void CSVDoc::View::closeEvent (QCloseEvent *event) event->ignore(); else { - // delete the subviews first - for (QList::iterator iter = mSubViews.begin(); iter != mSubViews.end(); ++iter) - delete *iter; - // closeRequest() returns true if last document mViewManager.removeDocAndView(mDocument); } @@ -98,7 +94,7 @@ void CSVDoc::View::setupEditMenu() QAction *search = new QAction (tr ("Search"), this); connect (search, SIGNAL (triggered()), this, SLOT (addSearchSubView())); - edit->addAction (search); + edit->addAction (search); } void CSVDoc::View::setupViewMenu()