@ -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();
@ -32,10 +32,6 @@ void CSVDoc::View::closeEvent (QCloseEvent *event)
event->ignore();
else
{
// delete the subviews first
for (QList<CSVDoc::SubView *>::iterator iter = mSubViews.begin(); iter != mSubViews.end(); ++iter)
delete *iter;
// closeRequest() returns true if last document
mViewManager.removeDocAndView(mDocument);
}