mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-01 03:10:06 +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
|
|
@ -174,7 +174,7 @@ bool ComponentPeer::handleKeyPress (const int keyCode,
|
|||
|
||||
while (target != 0)
|
||||
{
|
||||
const Component::SafePointer<Component> deletionChecker (target);
|
||||
const WeakReference<Component> deletionChecker (target);
|
||||
|
||||
if (target->keyListeners_ != 0)
|
||||
{
|
||||
|
|
@ -228,7 +228,7 @@ bool ComponentPeer::handleKeyUpOrDown (const bool isKeyDown)
|
|||
|
||||
while (target != 0)
|
||||
{
|
||||
const Component::SafePointer<Component> deletionChecker (target);
|
||||
const WeakReference<Component> deletionChecker (target);
|
||||
|
||||
keyWasUsed = target->keyStateChanged (isKeyDown);
|
||||
|
||||
|
|
@ -305,7 +305,7 @@ void ComponentPeer::handleMovedOrResized()
|
|||
|
||||
if (component->flags.hasHeavyweightPeerFlag && ! nowMinimised)
|
||||
{
|
||||
const Component::SafePointer<Component> deletionChecker (component);
|
||||
const WeakReference<Component> deletionChecker (component);
|
||||
|
||||
const Rectangle<int> newBounds (getBounds());
|
||||
const bool wasMoved = (component->getPosition() != newBounds.getPosition());
|
||||
|
|
@ -523,7 +523,7 @@ void ComponentPeer::handleFileDragDrop (const StringArray& files, const Point<in
|
|||
}
|
||||
|
||||
private:
|
||||
Component::SafePointer<Component> target;
|
||||
WeakReference<Component> target;
|
||||
FileDragAndDropTarget* dropTarget;
|
||||
Point<int> position;
|
||||
StringArray files;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue