1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

ModalComponentManager: Remove friendship with Component

This change makes it slightly easier to audit invariants of
ModalComponentManager, as we can now be certain that only member
functions of ModalComponentManager can access its data members.
This commit is contained in:
reuk 2024-05-13 17:06:26 +01:00
parent 24f3a91a35
commit d7788100d5
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
3 changed files with 17 additions and 21 deletions

View file

@ -1384,7 +1384,7 @@ void Component::enterModalState (bool shouldTakeKeyboardFocus,
}
auto& mcm = *ModalComponentManager::getInstance();
mcm.startModal (this, deleteWhenDismissed);
mcm.startModal ({}, this, deleteWhenDismissed);
mcm.attachCallback (this, callback);
setVisible (true);
@ -1408,7 +1408,7 @@ void Component::exitModalState (int returnValue)
if (MessageManager::getInstance()->isThisTheMessageThread())
{
auto& mcm = *ModalComponentManager::getInstance();
mcm.endModal (this, returnValue);
mcm.endModal ({}, this, returnValue);
mcm.bringModalComponentsToFront();
// While this component is in modal state it may block other components from receiving