Title: [100681] trunk/Source/WebCore
Revision
100681
Author
msab...@apple.com
Date
2011-11-17 14:49:31 -0800 (Thu, 17 Nov 2011)

Log Message

Leaks seen in MemoryPressureHandlerMac.mm on Leaks bot
https://bugs.webkit.org/show_bug.cgi?id=72416

Added code to release _cache_event_source and _timer_event_source
after they are canceled.  Also added defensive code to
clean up the _timer_event_source in uninstall().

Reviewed by Geoffrey Garen.

No new tests, fixing leaks caught by leaks bot.

* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::uninstall):
(WebCore::MemoryPressureHandler::holdOff):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (100680 => 100681)


--- trunk/Source/WebCore/ChangeLog	2011-11-17 22:49:26 UTC (rev 100680)
+++ trunk/Source/WebCore/ChangeLog	2011-11-17 22:49:31 UTC (rev 100681)
@@ -1,3 +1,20 @@
+2011-11-17  Michael Saboff  <msab...@apple.com>
+
+        Leaks seen in MemoryPressureHandlerMac.mm on Leaks bot
+        https://bugs.webkit.org/show_bug.cgi?id=72416
+
+        Added code to release _cache_event_source and _timer_event_source
+        after they are canceled.  Also added defensive code to
+        clean up the _timer_event_source in uninstall().
+
+        Reviewed by Geoffrey Garen.
+
+        No new tests, fixing leaks caught by leaks bot.
+
+        * platform/mac/MemoryPressureHandlerMac.mm:
+        (WebCore::MemoryPressureHandler::uninstall):
+        (WebCore::MemoryPressureHandler::holdOff):
+
 2011-11-17  Ken Buchanan <ke...@chromium.org>
 
         Crash from positioned generated content under run-in

Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (100680 => 100681)


--- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm	2011-11-17 22:49:26 UTC (rev 100680)
+++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm	2011-11-17 22:49:31 UTC (rev 100681)
@@ -76,7 +76,15 @@
         return;
 
     dispatch_source_cancel(_cache_event_source);
+    dispatch_release(_cache_event_source);
     _cache_event_source = 0;
+
+    if (_timer_event_source) {
+        dispatch_source_cancel(_timer_event_source);
+        dispatch_release(_timer_event_source);
+        _timer_event_source = 0;
+    }
+
     m_installed = false;
     
     notify_cancel(_notifyToken);
@@ -93,6 +101,7 @@
             dispatch_source_set_timer(_timer_event_source, dispatch_time(DISPATCH_TIME_NOW, seconds * NSEC_PER_SEC), DISPATCH_TIME_FOREVER, 1 * s_secondsBetweenMemoryCleanup);
             dispatch_source_set_event_handler(_timer_event_source, ^{
                 dispatch_source_cancel(_timer_event_source);
+                dispatch_release(_timer_event_source);
                 _timer_event_source = 0;
                 memoryPressureHandler().install();
             });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to