1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

clean up properly after closing a top level window

This commit is contained in:
Marc Zinnschlag 2012-11-23 10:30:14 +01:00
parent 03aacd3263
commit 04158d03b0
2 changed files with 1 additions and 5 deletions

View File

@ -36,9 +36,6 @@ CSVDoc::ViewManager::~ViewManager()
{ {
for (std::vector<View *>::iterator iter (mViews.begin()); iter!=mViews.end(); ++iter) for (std::vector<View *>::iterator iter (mViews.begin()); iter!=mViews.end(); ++iter)
delete *iter; delete *iter;
for (std::vector<View *>::iterator iter (mClosed.begin()); iter!=mClosed.end(); ++iter)
delete *iter;
} }
CSVDoc::View *CSVDoc::ViewManager::addView (CSMDoc::Document *document) 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 /// \todo check if document has not been saved -> return false and start close dialogue
mViews.erase (iter); mViews.erase (iter);
mClosed.push_back (view); view->deleteLater();
if (last) if (last)
mDocumentManager.removeDocument (view->getDocument()); mDocumentManager.removeDocument (view->getDocument());

View File

@ -21,7 +21,6 @@ namespace CSVDoc
CSMDoc::DocumentManager& mDocumentManager; CSMDoc::DocumentManager& mDocumentManager;
std::vector<View *> mViews; std::vector<View *> mViews;
std::vector<View *> mClosed;
// not implemented // not implemented
ViewManager (const ViewManager&); ViewManager (const ViewManager&);