Null deref in _clearImmediateActionState when closing a view with a DataDetectors...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Feb 2015 00:30:46 +0000 (00:30 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Feb 2015 00:30:46 +0000 (00:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=141377
<rdar://problem/19711203>

Reviewed by Darin Adler.

* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _clearImmediateActionState]):
We can have already detached the page when DataDetectors calls us back
in interactionStoppedHandler. While we have kept a strong reference to the
page in the interactionStoppedHandler block, _page is nulled out.
It's OK to avoid doing this work, in any case, because closing a page
tears down the TextIndicator anyway.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179809 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm

index 36481494a9ece6c7cef4e695aea05433d2dc7886..1db6b9a803a2e569f22224e98ee76ee0a03a0c11 100644 (file)
@@ -1,3 +1,19 @@
+2015-02-08  Timothy Horton  <timothy_horton@apple.com>
+
+        Null deref in _clearImmediateActionState when closing a view with a DataDetectors popover open
+        https://bugs.webkit.org/show_bug.cgi?id=141377
+        <rdar://problem/19711203>
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/mac/WKImmediateActionController.mm:
+        (-[WKImmediateActionController _clearImmediateActionState]):
+        We can have already detached the page when DataDetectors calls us back
+        in interactionStoppedHandler. While we have kept a strong reference to the
+        page in the interactionStoppedHandler block, _page is nulled out.
+        It's OK to avoid doing this work, in any case, because closing a page
+        tears down the TextIndicator anyway.
+
 2015-02-08  Chris Dumez  <cdumez@apple.com>
 
         [WK2] Add logging to validate the network cache efficacy (Part 1)
index c1b879f38b6607fc3c1e4e968581706353004a6b..2c7c9288c2a9af5395bedaf47fbc091d0206e921 100644 (file)
@@ -115,7 +115,8 @@ using namespace WebKit;
 
 - (void)_clearImmediateActionState
 {
-    _page->clearTextIndicator();
+    if (_page)
+        _page->clearTextIndicator();
 
     if (_currentActionContext && _hasActivatedActionContext) {
         _hasActivatedActionContext = NO;