Changeset 179720 in webkit


Ignore:
Timestamp:
Feb 5, 2015 3:47:35 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

[iOS] Remove False Positive dispatch_source Leak in WebMemoryPressureHandler singleton
https://bugs.webkit.org/show_bug.cgi?id=141307

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2015-02-05
Reviewed by Anders Carlsson.

  • UIProcess/ios/WebMemoryPressureHandlerIOS.h:
  • UIProcess/ios/WebMemoryPressureHandlerIOS.mm:

(WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
We want to keep the dispatch_source around, so just tie it to the
singleton so that it is not reported as a leak.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r179708 r179720  
     12015-02-05  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        [iOS] Remove False Positive dispatch_source Leak in WebMemoryPressureHandler singleton
     4        https://bugs.webkit.org/show_bug.cgi?id=141307
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * UIProcess/ios/WebMemoryPressureHandlerIOS.h:
     9        * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
     10        (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
     11        We want to keep the dispatch_source around, so just tie it to the
     12        singleton so that it is not reported as a leak.
     13
    1142015-02-05  Antti Koivisto  <antti@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/ios/WebMemoryPressureHandlerIOS.h

    r179409 r179720  
    2929#if PLATFORM(IOS)
    3030
    31 #include <wtf/NeverDestroyed.h>
     31#import <dispatch/dispatch.h>
     32#import <wtf/NeverDestroyed.h>
    3233
    3334namespace WebKit {
     
    4041private:
    4142    WebMemoryPressureHandler();
     43    dispatch_source_t _source;
    4244};
    4345
  • trunk/Source/WebKit2/UIProcess/ios/WebMemoryPressureHandlerIOS.mm

    r179409 r179720  
    4646    // and you can only have one WebCore::MemoryPressureHandler.
    4747
    48     dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS, 0, DISPATCH_MEMORYSTATUS_PRESSURE_WARN, dispatch_get_main_queue());
    49     dispatch_set_context(source, this);
    50     dispatch_source_set_event_handler(source, ^{
     48    _source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS, 0, DISPATCH_MEMORYSTATUS_PRESSURE_WARN, dispatch_get_main_queue());
     49    dispatch_set_context(_source, this);
     50    dispatch_source_set_event_handler(_source, ^{
    5151        ViewSnapshotStore::singleton().discardSnapshotImages();
    5252    });
    53     dispatch_resume(source);
     53    dispatch_resume(_source);
    5454}
    5555
Note: See TracChangeset for help on using the changeset viewer.