Title: [202426] trunk/Source/WebKit2
Revision
202426
Author
[email protected]
Date
2016-06-24 10:13:38 -0700 (Fri, 24 Jun 2016)

Log Message

[WK2] PageConfiguration.m_relatedPage keeps WebPageProxy alive after its WebView has been destroyed
https://bugs.webkit.org/show_bug.cgi?id=159080
<rdar://problem/26982642>

Reviewed by Anders Carlsson.

PageConfiguration.m_relatedPage keeps WebPageProxy alive after its WebView has been destroyed.
This leads to WebPageProxy object leaks when the client keeps chaining related views.

In this patch, we null our the PageConfiguration's relatedPage in WebPageProxy::close()
to break the chain and make sure we only keep alive 1 relatedPage rather than a chain of
them.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (202425 => 202426)


--- trunk/Source/WebKit2/ChangeLog	2016-06-24 17:12:10 UTC (rev 202425)
+++ trunk/Source/WebKit2/ChangeLog	2016-06-24 17:13:38 UTC (rev 202426)
@@ -1,3 +1,21 @@
+2016-06-24  Chris Dumez  <[email protected]>
+
+        [WK2] PageConfiguration.m_relatedPage keeps WebPageProxy alive after its WebView has been destroyed
+        https://bugs.webkit.org/show_bug.cgi?id=159080
+        <rdar://problem/26982642>
+
+        Reviewed by Anders Carlsson.
+
+        PageConfiguration.m_relatedPage keeps WebPageProxy alive after its WebView has been destroyed.
+        This leads to WebPageProxy object leaks when the client keeps chaining related views.
+
+        In this patch, we null our the PageConfiguration's relatedPage in WebPageProxy::close()
+        to break the chain and make sure we only keep alive 1 relatedPage rather than a chain of
+        them.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::close):
+
 2016-06-24  Jer Noble  <[email protected]>
 
         Playback controls refer to wrong element when playing multiple items in a page.

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (202425 => 202426)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-06-24 17:12:10 UTC (rev 202425)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-06-24 17:13:38 UTC (rev 202426)
@@ -870,6 +870,9 @@
     m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID);
     m_process->processPool().supplement<WebNotificationManagerProxy>()->clearNotifications(this);
 
+    // Null out related WebPageProxy to avoid leaks.
+    m_configuration->setRelatedPage(nullptr);
+
 #if PLATFORM(IOS)
     // Make sure we don't hold a process assertion after getting closed.
     m_activityToken = nullptr;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to