mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-21 01:24:21 +00:00
UIViewComponentPeer: Fix issue where view may be accessed after deletion
This commit is contained in:
parent
819736054f
commit
92ca22c080
1 changed files with 12 additions and 1 deletions
|
|
@ -271,7 +271,12 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c)
|
|||
static bool isKioskModeView (JuceUIViewController* c)
|
||||
{
|
||||
JuceUIView* juceView = (JuceUIView*) [c view];
|
||||
jassert (juceView != nil && juceView->owner != nullptr);
|
||||
|
||||
if (juceView == nil || juceView->owner == nullptr)
|
||||
{
|
||||
jassertfalse;
|
||||
return false;
|
||||
}
|
||||
|
||||
return Desktop::getInstance().getKioskModeComponent() == &(juceView->owner->getComponent());
|
||||
}
|
||||
|
|
@ -565,6 +570,12 @@ UIViewComponentPeer::~UIViewComponentPeer()
|
|||
if (! isSharedWindow)
|
||||
{
|
||||
[((JuceUIWindow*) window) setOwner: nil];
|
||||
|
||||
#if defined (__IPHONE_13_0)
|
||||
if (@available (iOS 13.0, *))
|
||||
window.windowScene = nil;
|
||||
#endif
|
||||
|
||||
[window release];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue