Changeset 228580 in webkit


Ignore:
Timestamp:
Feb 16, 2018 1:56:16 PM (6 years ago)
Author:
Brent Fulgham
Message:

[Cocoa][WebKitLegacy] REGRESSION(r221559): Coda 2 crashes when switching views
https://bugs.webkit.org/show_bug.cgi?id=182882
<rdar://problem/35672661>

Reviewed by Dan Bernstein.

Make sure the smart pointer hold the collection of subviews lives at least as
long as the loop using it.

  • WebView/WebHTMLView.mm:

(-[WebHTMLView _web_makePluginSubviewsPerformSelector:withObject:]):

Location:
trunk/Source/WebKitLegacy/mac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r228486 r228580  
     12018-02-16  Brent Fulgham  <bfulgham@apple.com>
     2
     3        [Cocoa][WebKitLegacy] REGRESSION(r221559): Coda 2 crashes when switching views
     4        https://bugs.webkit.org/show_bug.cgi?id=182882
     5        <rdar://problem/35672661>
     6
     7        Reviewed by Dan Bernstein.
     8
     9        Make sure the smart pointer hold the collection of subviews lives at least as
     10        long as the loop using it.
     11
     12        * WebView/WebHTMLView.mm:
     13        (-[WebHTMLView _web_makePluginSubviewsPerformSelector:withObject:]):
     14
    1152018-02-14  Daniel Bates  <dabates@apple.com>
    216
  • trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm

    r228260 r228580  
    11/*
    2  * Copyright (C) 2005-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2005-2018 Apple Inc. All rights reserved.
    33 *           (C) 2006, 2007 Graham Dennis (graham.dennis@gmail.com)
    44 *
     
    14281428    // Copy subviews because [self subviews] returns the view's mutable internal array,
    14291429    // and we must avoid mutating the array while enumerating it.
    1430     for (NSView *view in adoptNS([[self subviews] copy]).get()) {
     1430    auto subviewsCopy = adoptNS([self.subviews copy]);
     1431    for (NSView *view in subviewsCopy.get()) {
    14311432        if ([view isKindOfClass:[WebBaseNetscapePluginView class]])
    14321433            [view performSelector:selector withObject:object];
Note: See TracChangeset for help on using the changeset viewer.