Title: [151372] releases/WebKitGTK/webkit-2.0/Source/WebKit2
Revision
151372
Author
[email protected]
Date
2013-06-10 02:56:37 -0700 (Mon, 10 Jun 2013)

Log Message

Merge r151270 - [Gtk] Connection is leaking when WebProcess is terminated
https://bugs.webkit.org/show_bug.cgi?id=117293

Reviewed by Martin Robinson.

Connection is leaking because WorkQueue::SocketEventSource inherits from
WorkQueue::EventSource but when it is destroyed, the actual destructor running
is the one from base class; however, subclass contains a function binded from
Connection (m_closeFunction) and we need to do this extra cleanup, otherwise
WorkQueue will keep Connection alive. A better explanation of this fix is provided
on http://stackoverflow.com/questions/461203/when-to-use-virtual-destructors

A quick way to see the leak is to change WK2 test "ReloadPageAfterCrash" to terminate
WebProcess N times and add a printf on Connection destructor.

* Platform/gtk/WorkQueueGtk.cpp:
(WorkQueue::EventSource::~EventSource): Adds a virtual destructor to enable
the subclass to do its own cleanup.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.0/Source/WebKit2/ChangeLog (151371 => 151372)


--- releases/WebKitGTK/webkit-2.0/Source/WebKit2/ChangeLog	2013-06-10 09:43:00 UTC (rev 151371)
+++ releases/WebKitGTK/webkit-2.0/Source/WebKit2/ChangeLog	2013-06-10 09:56:37 UTC (rev 151372)
@@ -1,3 +1,24 @@
+2013-06-06  Rafael Brandao  <[email protected]>
+
+        [Gtk] Connection is leaking when WebProcess is terminated
+        https://bugs.webkit.org/show_bug.cgi?id=117293
+
+        Reviewed by Martin Robinson.
+
+        Connection is leaking because WorkQueue::SocketEventSource inherits from
+        WorkQueue::EventSource but when it is destroyed, the actual destructor running
+        is the one from base class; however, subclass contains a function binded from
+        Connection (m_closeFunction) and we need to do this extra cleanup, otherwise
+        WorkQueue will keep Connection alive. A better explanation of this fix is provided
+        on http://stackoverflow.com/questions/461203/when-to-use-virtual-destructors
+
+        A quick way to see the leak is to change WK2 test "ReloadPageAfterCrash" to terminate
+        WebProcess N times and add a printf on Connection destructor.
+
+        * Platform/gtk/WorkQueueGtk.cpp:
+        (WorkQueue::EventSource::~EventSource): Adds a virtual destructor to enable
+        the subclass to do its own cleanup.
+
 2013-05-28  Lauro Neto <[email protected]>
 
         [GTK] Connection issues in repeated WebProcess crash/reloads.

Modified: releases/WebKitGTK/webkit-2.0/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp (151371 => 151372)


--- releases/WebKitGTK/webkit-2.0/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp	2013-06-10 09:43:00 UTC (rev 151371)
+++ releases/WebKitGTK/webkit-2.0/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp	2013-06-10 09:56:37 UTC (rev 151372)
@@ -43,6 +43,8 @@
         ASSERT(workQueue);
     }
 
+    virtual ~EventSource() { }
+
     void performWork()
     {
         m_function();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to