Title: [190819] trunk/Tools
Revision
190819
Author
simon.fra...@apple.com
Date
2015-10-09 14:34:56 -0700 (Fri, 09 Oct 2015)

Log Message

[iOS WK2] Fix some leaks in TestRunnerWKWebView and UIScriptContext
https://bugs.webkit.org/show_bug.cgi?id=149960

Reviewed by Tim Horton.

Use adoptWK(), and null out some members (file is not using ARC).

* WebKitTestRunner/UIScriptContext/UIScriptContext.cpp:
(UIScriptContext::uiScriptComplete):
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView dealloc]):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (190818 => 190819)


--- trunk/Tools/ChangeLog	2015-10-09 21:07:25 UTC (rev 190818)
+++ trunk/Tools/ChangeLog	2015-10-09 21:34:56 UTC (rev 190819)
@@ -1,3 +1,17 @@
+2015-10-09  Simon Fraser  <simon.fra...@apple.com>
+
+        [iOS WK2] Fix some leaks in TestRunnerWKWebView and UIScriptContext
+        https://bugs.webkit.org/show_bug.cgi?id=149960
+
+        Reviewed by Tim Horton.
+        
+        Use adoptWK(), and null out some members (file is not using ARC).
+
+        * WebKitTestRunner/UIScriptContext/UIScriptContext.cpp:
+        (UIScriptContext::uiScriptComplete):
+        * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
+        (-[TestRunnerWKWebView dealloc]):
+
 2015-10-09  Csaba Osztrogonác  <o...@webkit.org>
 
         Remove ENABLE_SUID_SANDBOX_LINUX cruft

Modified: trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptContext.cpp (190818 => 190819)


--- trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptContext.cpp	2015-10-09 21:07:25 UTC (rev 190818)
+++ trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptContext.cpp	2015-10-09 21:34:56 UTC (rev 190819)
@@ -138,7 +138,7 @@
 
 void UIScriptContext::uiScriptComplete(JSStringRef result)
 {
-    WKRetainPtr<WKStringRef> uiScriptResult = WKStringCreateWithJSString(result);
+    WKRetainPtr<WKStringRef> uiScriptResult = adoptWK(WKStringCreateWithJSString(result));
     m_delegate.uiScriptDidComplete(uiScriptResult.get(), m_currentScriptCallbackID);
     m_currentScriptCallbackID = 0;
 }

Modified: trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm (190818 => 190819)


--- trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm	2015-10-09 21:07:25 UTC (rev 190818)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm	2015-10-09 21:34:56 UTC (rev 190819)
@@ -70,8 +70,17 @@
 
 - (void)dealloc
 {
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+    self.willBeginZoomingCallback = nil;
+    self.didEndZoomingCallback = nil;
+    self.didShowKeyboardCallback = nil;
+    self.didHideKeyboardCallback = nil;
+
+    self.zoomToScaleCompletionHandler = nil;
+    self.showKeyboardCompletionHandler = nil;
+
     [super dealloc];
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
 }
 
 - (void)zoomToScale:(double)scale animated:(BOOL)animated completionHandler:(void (^)(void))completionHandler
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to