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

Changeset 273297 in webkit


Ignore:
Timestamp:
Feb 22, 2021, 7:34:22 PM (6 years ago)
Author:
Devin Rousso
Message:

[Payment Request] REGRESSION(r273143): crash shortly after showing the Apple Pay sheet
​https://bugs.webkit.org/show_bug.cgi?id=222298
<rdar://problem/74557943>

Reviewed by Wenson Hsieh.

  • Platform/cocoa/PaymentAuthorizationPresenter.mm:

(WebKit::toNSErrors):
Don't use adoptNS with +[NSMutableArray array] since that returns an autoreleased object.
Use the helper createNSArray instead (as was previously done before r273143).

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r273296 r273297  
     12021-02-22  Devin Rousso  <drousso@apple.com>
     2
     3        [Payment Request] REGRESSION(r273143): crash shortly after showing the Apple Pay sheet
     4        https://bugs.webkit.org/show_bug.cgi?id=222298
     5        <rdar://problem/74557943>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        * Platform/cocoa/PaymentAuthorizationPresenter.mm:
     10        (WebKit::toNSErrors):
     11        Don't use `adoptNS` with `+[NSMutableArray array]` since that returns an autoreleased object.
     12        Use the helper `createNSArray` instead (as was previously done before r273143).
     13
    1142021-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
    215
  • trunk/Source/WebKit/Platform/cocoa/PaymentAuthorizationPresenter.mm

    r273159 r273297  
    181181static RetainPtr<NSArray> toNSErrors(const Vector<RefPtr<WebCore::ApplePayError>>& errors)
    182182{
    183     auto array = adoptNS(NSMutableArray.array);
    184     for (auto& error : errors) {
    185         if (error)
    186             [array addObject:toNSError(*error)];
    187     }
    188     return array;
     183    return createNSArray(errors, [] (auto& error) -> NSError * {
     184        return error ? toNSError(*error) : nil;
     185    });
    189186}
    190187
Note: See TracChangeset for help on using the changeset viewer.