⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 263869 in webkit


Ignore:
Timestamp:
Jul 2, 2020, 3:43:59 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Crash in +[UIViewController _viewControllerForFullScreenPresentationFromView:] when WKContentView is deallocated
https://bugs.webkit.org/show_bug.cgi?id=213867

Patch by Austin Blackwood <ablackwoood@apple.com> on 2020-07-02
Reviewed by Darin Adler.

+[UIViewController _viewControllerForFullScreenPresentationFromView:]
asserts that the view parameter is non-nil. WKFileUploadPanel
passes its view (a weak pointer to the WKContentView), which may
have already been nil'd out when the content view tries to dismiss
the panel in its own dealloc.

  • UIProcess/ios/forms/WKFileUploadPanel.mm:

(-[WKFileUploadPanel dismiss]):
Check for nil.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r263857 r263869  
     12020-07-02  Austin Blackwood  <ablackwoood@apple.com>
     2
     3        Crash in +[UIViewController _viewControllerForFullScreenPresentationFromView:] when WKContentView is deallocated
     4        https://bugs.webkit.org/show_bug.cgi?id=213867
     5
     6        Reviewed by Darin Adler.
     7
     8        +[UIViewController _viewControllerForFullScreenPresentationFromView:]
     9        asserts that the view parameter is non-nil. WKFileUploadPanel
     10        passes its view (a weak pointer to the WKContentView), which may
     11        have already been nil'd out when the content view tries to dismiss
     12        the panel in its own dealloc.
     13
     14        * UIProcess/ios/forms/WKFileUploadPanel.mm:
     15        (-[WKFileUploadPanel dismiss]):
     16        Check for nil.
     17
    1182020-07-02  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm

    r261303 r263869  
    284284    // Dismiss any view controller that is being presented. This works for all types of view controllers, popovers, etc.
    285285    // If there is any kind of view controller presented on this view, it will be removed.
    286    
    287     [[UIViewController _viewControllerForFullScreenPresentationFromView:_view.getAutoreleased()] dismissViewControllerAnimated:NO completion:nil];
     286
     287    if (auto view = _view.get())
     288        [[UIViewController _viewControllerForFullScreenPresentationFromView:view.get()] dismissViewControllerAnimated:NO completion:nil];
    288289   
    289290    [_presentationPopover setDelegate:nil];
    290291    _presentationPopover = nil;
    291292    _presentationViewController = nil;
    292    
     293
    293294    [self _cancel];
    294295}
Note: See TracChangeset for help on using the changeset viewer.