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

Use C++14 lambda capture initialisers for initialising deletion checkers

This commit is contained in:
ed 2021-07-12 11:58:29 +01:00
parent 5a78b06f5c
commit a5c3b81f82
33 changed files with 159 additions and 193 deletions

View file

@ -192,8 +192,10 @@ void Desktop::handleAsyncUpdate()
{
// The component may be deleted during this operation, but we'll use a SafePointer rather than a
// BailOutChecker so that any remaining listeners will still get a callback (with a null pointer).
WeakReference<Component> currentFocus (Component::getCurrentlyFocusedComponent());
focusListeners.call ([&] (FocusChangeListener& l) { l.globalFocusChanged (currentFocus.get()); });
focusListeners.call ([currentFocus = WeakReference<Component> { Component::getCurrentlyFocusedComponent() }] (FocusChangeListener& l)
{
l.globalFocusChanged (currentFocus.get());
});
}
//==============================================================================