Title: [228580] trunk/Source/WebKitLegacy/mac
Revision
228580
Author
[email protected]
Date
2018-02-16 13:56:16 -0800 (Fri, 16 Feb 2018)

Log 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:]):

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (228579 => 228580)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2018-02-16 21:53:18 UTC (rev 228579)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2018-02-16 21:56:16 UTC (rev 228580)
@@ -1,3 +1,17 @@
+2018-02-16  Brent Fulgham  <[email protected]>
+
+        [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:]):
+
 2018-02-14  Daniel Bates  <[email protected]>
 
         Disallow cross-origin subresources from asking for credentials

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (228579 => 228580)


--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2018-02-16 21:53:18 UTC (rev 228579)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2018-02-16 21:56:16 UTC (rev 228580)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2005-2018 Apple Inc. All rights reserved.
  *           (C) 2006, 2007 Graham Dennis ([email protected])
  *
  * Redistribution and use in source and binary forms, with or without
@@ -1427,7 +1427,8 @@
 {
     // Copy subviews because [self subviews] returns the view's mutable internal array,
     // and we must avoid mutating the array while enumerating it.
-    for (NSView *view in adoptNS([[self subviews] copy]).get()) {
+    auto subviewsCopy = adoptNS([self.subviews copy]);
+    for (NSView *view in subviewsCopy.get()) {
         if ([view isKindOfClass:[WebBaseNetscapePluginView class]])
             [view performSelector:selector withObject:object];
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to