Occasional crash under -[WKFormInputSession setSuggestions:]
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jul 2018 21:28:02 +0000 (21:28 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jul 2018 21:28:02 +0000 (21:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187869
<rdar://problem/41357063>

Reviewed by Dean Jackson.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView inputDelegate]):
Make inputDelegate weak.

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

index ccc60d0..cd0d207 100644 (file)
@@ -1,3 +1,16 @@
+2018-07-20  Tim Horton  <timothy_horton@apple.com>
+
+        Occasional crash under -[WKFormInputSession setSuggestions:]
+        https://bugs.webkit.org/show_bug.cgi?id=187869
+        <rdar://problem/41357063>
+
+        Reviewed by Dean Jackson.
+
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView inputDelegate]):
+        Make inputDelegate weak.
+
 2018-07-20  Brent Fulgham  <bfulgham@apple.com>
 
         [macOS] Relax WebKit sandbox to permit proper App Store behavior
index 8ac7301..f8e4584 100644 (file)
@@ -44,6 +44,7 @@
 #import <wtf/BlockPtr.h>
 #import <wtf/Forward.h>
 #import <wtf/Vector.h>
+#import <wtf/WeakObjCPtr.h>
 #import <wtf/text/WTFString.h>
 
 namespace API {
@@ -182,7 +183,7 @@ struct WKAutoCorrectionData {
 
     std::unique_ptr<WebKit::SmartMagnificationController> _smartMagnificationController;
 
-    id <UITextInputDelegate> _inputDelegate;
+    WeakObjCPtr<id <UITextInputDelegate>> _inputDelegate;
 
     uint64_t _latestTapID;
     struct TapHighlightInformation {
index 6a166ed..c89397c 100644 (file)
@@ -899,7 +899,7 @@ static inline bool hasAssistedNode(WebKit::AssistedNodeInformation assistedNodeI
 
 - (id <UITextInputDelegate>)inputDelegate
 {
-    return _inputDelegate;
+    return _inputDelegate.getAutoreleased();
 }
 
 - (CGPoint)lastInteractionLocation