Title: [195424] trunk/Source/WebKit2
Revision
195424
Author
d...@apple.com
Date
2016-01-21 15:34:01 -0800 (Thu, 21 Jan 2016)

Log Message

[iOS] Crash in _endPotentialTapAndEnableDoubleTapGesturesIfNecessary
https://bugs.webkit.org/show_bug.cgi?id=153326
<rdar://problem/24264339>

Reviewed by Anders Carlsson.

UIKit's UIGestureRecognizer could call back into the WKContentView
after the associated WKWebView has disappeared. The fix is to
explicitly null the WKWebView reference as we deallocate.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView dealloc]): Tell the WKContentView we are going away.
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _webViewDestroyed]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]):
Only do something if the WKWebView is still around.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (195423 => 195424)


--- trunk/Source/WebKit2/ChangeLog	2016-01-21 23:15:46 UTC (rev 195423)
+++ trunk/Source/WebKit2/ChangeLog	2016-01-21 23:34:01 UTC (rev 195424)
@@ -1,3 +1,24 @@
+2016-01-21  Dean Jackson  <d...@apple.com>
+
+        [iOS] Crash in _endPotentialTapAndEnableDoubleTapGesturesIfNecessary
+        https://bugs.webkit.org/show_bug.cgi?id=153326
+        <rdar://problem/24264339>
+
+        Reviewed by Anders Carlsson.
+
+        UIKit's UIGestureRecognizer could call back into the WKContentView
+        after the associated WKWebView has disappeared. The fix is to
+        explicitly null the WKWebView reference as we deallocate.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView dealloc]): Tell the WKContentView we are going away.
+        * UIProcess/ios/WKContentView.h:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView _webViewDestroyed]):
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]):
+        Only do something if the WKWebView is still around.
+
 2016-01-21  Beth Dakin  <bda...@apple.com>
 
         Add the ability to update WebKitAdditions to WK2

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (195423 => 195424)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2016-01-21 23:15:46 UTC (rev 195423)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2016-01-21 23:34:01 UTC (rev 195424)
@@ -484,6 +484,8 @@
 #endif
 
 #if PLATFORM(IOS)
+    [_contentView _webViewDestroyed];
+
     if (_remoteObjectRegistry)
         _page->process().processPool().removeMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID());
 

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.h (195423 => 195424)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.h	2016-01-21 23:15:46 UTC (rev 195423)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.h	2016-01-21 23:34:01 UTC (rev 195424)
@@ -75,6 +75,8 @@
 - (void)didZoomToScale:(CGFloat)scale;
 - (void)willStartZoomOrScroll;
 
+- (void)_webViewDestroyed;
+
 - (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy;
 - (void)_processDidExit;
 - (void)_didRelaunchProcess;

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (195423 => 195424)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm	2016-01-21 23:15:46 UTC (rev 195423)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm	2016-01-21 23:34:01 UTC (rev 195424)
@@ -453,6 +453,11 @@
     }
 }
 
+- (void)_webViewDestroyed
+{
+    _webView = nil;
+}
+
 #pragma mark PageClientImpl methods
 
 - (std::unique_ptr<DrawingAreaProxy>)_createDrawingAreaProxy
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to