mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-05 03:50:07 +00:00
New class: WeakReference. Used this to clean up and simplify implementation of Component::SafePointer and BailOutChecker.
This commit is contained in:
parent
d60f661789
commit
2bb0c77216
41 changed files with 655 additions and 275 deletions
|
|
@ -149,7 +149,7 @@ void Button::setToggleState (const bool shouldBeOn,
|
|||
|
||||
if (sendChangeNotification)
|
||||
{
|
||||
Component::SafePointer<Component> deletionWatcher (this);
|
||||
WeakReference<Component> deletionWatcher (this);
|
||||
sendClickMessage (ModifierKeys());
|
||||
|
||||
if (deletionWatcher == 0)
|
||||
|
|
@ -200,7 +200,7 @@ void Button::turnOffOtherButtonsInGroup (const bool sendChangeNotification)
|
|||
|
||||
if (p != 0 && radioGroupId != 0)
|
||||
{
|
||||
Component::SafePointer<Component> deletionWatcher (this);
|
||||
WeakReference<Component> deletionWatcher (this);
|
||||
|
||||
for (int i = p->getNumChildComponents(); --i >= 0;)
|
||||
{
|
||||
|
|
@ -460,7 +460,7 @@ void Button::parentHierarchyChanged()
|
|||
{
|
||||
Component* const newKeySource = (shortcuts.size() == 0) ? 0 : getTopLevelComponent();
|
||||
|
||||
if (newKeySource != keySource.getComponent())
|
||||
if (newKeySource != keySource.get())
|
||||
{
|
||||
if (keySource != 0)
|
||||
keySource->removeKeyListener (this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue