From 04158d03b05cc63ba238835821a4125ea0ba8869 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 23 Nov 2012 10:30:14 +0100 Subject: [PATCH] clean up properly after closing a top level window --- apps/opencs/view/doc/viewmanager.cpp | 5 +---- apps/opencs/view/doc/viewmanager.hpp | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/opencs/view/doc/viewmanager.cpp b/apps/opencs/view/doc/viewmanager.cpp index 752501b199..7f94f52a2a 100644 --- a/apps/opencs/view/doc/viewmanager.cpp +++ b/apps/opencs/view/doc/viewmanager.cpp @@ -36,9 +36,6 @@ CSVDoc::ViewManager::~ViewManager() { for (std::vector::iterator iter (mViews.begin()); iter!=mViews.end(); ++iter) delete *iter; - - for (std::vector::iterator iter (mClosed.begin()); iter!=mClosed.end(); ++iter) - delete *iter; } CSVDoc::View *CSVDoc::ViewManager::addView (CSMDoc::Document *document) @@ -87,7 +84,7 @@ bool CSVDoc::ViewManager::closeRequest (View *view) /// \todo check if document has not been saved -> return false and start close dialogue mViews.erase (iter); - mClosed.push_back (view); + view->deleteLater(); if (last) mDocumentManager.removeDocument (view->getDocument()); diff --git a/apps/opencs/view/doc/viewmanager.hpp b/apps/opencs/view/doc/viewmanager.hpp index 8cfc36f3fd..bcf6dc59e2 100644 --- a/apps/opencs/view/doc/viewmanager.hpp +++ b/apps/opencs/view/doc/viewmanager.hpp @@ -21,7 +21,6 @@ namespace CSVDoc CSMDoc::DocumentManager& mDocumentManager; std::vector mViews; - std::vector mClosed; // not implemented ViewManager (const ViewManager&);