1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-02 03:20:06 +00:00

Introjucer: avoided problems when closing a GUI comp which is a sub-component of another currently-loaded GUI component.

This commit is contained in:
jules 2013-10-15 20:53:28 +01:00
parent 59b9b0ccaf
commit 8e4825e7bd
11 changed files with 38 additions and 17 deletions

View file

@ -195,8 +195,14 @@ bool OpenDocumentManager::closeDocument (int index, bool saveIfNeeded)
if (saveIfNeededAndUserAgrees (doc) != FileBasedDocument::savedOk)
return false;
bool canClose = true;
for (int i = listeners.size(); --i >= 0;)
listeners.getUnchecked(i)->documentAboutToClose (doc);
if (! listeners.getUnchecked(i)->documentAboutToClose (doc))
canClose = false;
if (! canClose)
return false;
documents.remove (index);
IntrojucerApp::getCommandManager().commandStatusChanged();
@ -359,13 +365,15 @@ OpenDocumentManager::Document* RecentDocumentList::getClosestPreviousDocOtherTha
return nullptr;
}
void RecentDocumentList::documentAboutToClose (OpenDocumentManager::Document* document)
bool RecentDocumentList::documentAboutToClose (OpenDocumentManager::Document* document)
{
previousDocs.removeAllInstancesOf (document);
nextDocs.removeAllInstancesOf (document);
jassert (! previousDocs.contains (document));
jassert (! nextDocs.contains (document));
return true;
}
static void restoreDocList (Project& project, Array <OpenDocumentManager::Document*>& list, const XmlElement* xml)