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:
parent
03aacd3263
commit
04158d03b0
@ -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());
|
||||||
|
@ -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&);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user