Title: [260994] trunk/Source/WebKit
Revision
260994
Author
ddkil...@apple.com
Date
2020-05-01 03:26:33 -0700 (Fri, 01 May 2020)

Log Message

REGRESSION (r260214): Leak of _WKTextInputContext in -[WKContentView _isTextInputContextFocused:]
<https://webkit.org/b/211276>
<rdar://problem/62696724>

Reviewed by Daniel Bates.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _focusTextInputContext:placeCaretAt:completionHandler:]):
- Use RetainPtr<> to pass the copy of _WKTextInputContext into
  the block to fix the leak.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (260993 => 260994)


--- trunk/Source/WebKit/ChangeLog	2020-05-01 10:26:10 UTC (rev 260993)
+++ trunk/Source/WebKit/ChangeLog	2020-05-01 10:26:33 UTC (rev 260994)
@@ -1,3 +1,16 @@
+2020-05-01  David Kilzer  <ddkil...@apple.com>
+
+        REGRESSION (r260214): Leak of _WKTextInputContext in -[WKContentView _isTextInputContextFocused:]
+        <https://webkit.org/b/211276>
+        <rdar://problem/62696724>
+
+        Reviewed by Daniel Bates.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _focusTextInputContext:placeCaretAt:completionHandler:]):
+        - Use RetainPtr<> to pass the copy of _WKTextInputContext into
+          the block to fix the leak.
+
 2020-05-01  Saam Barati  <sbar...@apple.com>
 
         We can't cast toLength result to unsigned

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (260993 => 260994)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-05-01 10:26:10 UTC (rev 260993)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-05-01 10:26:33 UTC (rev 260994)
@@ -5130,13 +5130,13 @@
         return;
     }
     _usingGestureForSelection = YES;
-    auto checkFocusedElement = [weakSelf = WeakObjCPtr<WKContentView> { self }, context = [context copy], completionHandler = makeBlockPtr(completionHandler)] (bool success) {
+    auto checkFocusedElement = [weakSelf = WeakObjCPtr<WKContentView> { self }, context = adoptNS([context copy]), completionHandler = makeBlockPtr(completionHandler)] (bool success) {
         auto strongSelf = weakSelf.get();
         if (!strongSelf) {
             completionHandler(nil);
             return;
         }
-        bool isFocused = success && [strongSelf _isTextInputContextFocused:context];
+        bool isFocused = success && [strongSelf _isTextInputContextFocused:context.get()];
         bool isEditable = success && !strongSelf->_focusedElementInformation.isReadOnly;
         strongSelf->_textInteractionDidChangeFocusedElement |= isFocused;
         strongSelf->_usingGestureForSelection = NO;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to