mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed a potential crash in DropShadower when the component is deleted before the shadower
This commit is contained in:
parent
8a2c6ad8f7
commit
547dc7712c
2 changed files with 6 additions and 9 deletions
|
|
@ -76,10 +76,7 @@ private:
|
|||
|
||||
|
||||
//==============================================================================
|
||||
DropShadower::DropShadower (const DropShadow& ds)
|
||||
: owner (nullptr), shadow (ds), reentrant (false)
|
||||
{
|
||||
}
|
||||
DropShadower::DropShadower (const DropShadow& ds) : shadow (ds) {}
|
||||
|
||||
DropShadower::~DropShadower()
|
||||
{
|
||||
|
|
@ -91,7 +88,7 @@ DropShadower::~DropShadower()
|
|||
|
||||
updateParent();
|
||||
|
||||
reentrant = true;
|
||||
const ScopedValueSetter<bool> setter (reentrant, true);
|
||||
shadowWindows.clear();
|
||||
}
|
||||
|
||||
|
|
@ -163,7 +160,7 @@ void DropShadower::updateShadows()
|
|||
if (reentrant)
|
||||
return;
|
||||
|
||||
const ScopedValueSetter<bool> setter (reentrant, true, false);
|
||||
const ScopedValueSetter<bool> setter (reentrant, true);
|
||||
|
||||
if (owner == nullptr)
|
||||
{
|
||||
|
|
@ -209,7 +206,7 @@ void DropShadower::updateShadows()
|
|||
if (sw == nullptr)
|
||||
return;
|
||||
|
||||
sw->toBehind (i == 3 ? owner : shadowWindows.getUnchecked (i + 1));
|
||||
sw->toBehind (i == 3 ? owner.get() : shadowWindows.getUnchecked (i + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,10 +60,10 @@ private:
|
|||
//==============================================================================
|
||||
class ShadowWindow;
|
||||
|
||||
Component* owner;
|
||||
WeakReference<Component> owner;
|
||||
OwnedArray<Component> shadowWindows;
|
||||
DropShadow shadow;
|
||||
bool reentrant;
|
||||
bool reentrant = false;
|
||||
WeakReference<Component> lastParentComp;
|
||||
|
||||
void componentMovedOrResized (Component&, bool, bool) override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue