Changeset 165412 in webkit


Ignore:
Timestamp:
Mar 10, 2014 4:08:55 PM (10 years ago)
Author:
Simon Fraser
Message:

Fix three leaks
https://bugs.webkit.org/show_bug.cgi?id=130048

Reviewed by Anders Carlsson.

Source/WebCore:

The NSDictionary was leaked.

  • page/ios/UserAgentIOS.mm:

(WebCore::osMarketingVersion):

Source/WebKit2:

  • Shared/API/Cocoa/WKRemoteObjectCoder.mm:

(decodeObject): Code is simpler and less leaky without the RetainPtr.

  • UIProcess/API/Cocoa/WKNavigationAction.mm: Fix _originalURL leak

by making it a RetainPtr and implementing the getter and setter.
(-[WKNavigationAction _setOriginalURL:]):
(-[WKNavigationAction _originalURL]):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r165409 r165412  
     12014-03-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix three leaks
     4        https://bugs.webkit.org/show_bug.cgi?id=130048
     5
     6        Reviewed by Anders Carlsson.
     7
     8        The NSDictionary was leaked.
     9
     10        * page/ios/UserAgentIOS.mm:
     11        (WebCore::osMarketingVersion):
     12
    1132014-03-10  Beth Dakin  <bdakin@apple.com>
    214
  • trunk/Source/WebCore/page/ios/UserAgentIOS.mm

    r162114 r165412  
    4545static NSString *osMarketingVersion()
    4646{
    47     RetainPtr<NSDictionary> systemInfo = [[NSDictionary alloc] initWithContentsOfFile:[platformSystemRootDirectory() stringByAppendingPathComponent:@"System/Library/CoreServices/SystemVersion.plist"]];
     47    RetainPtr<NSDictionary> systemInfo = adoptNS([[NSDictionary alloc] initWithContentsOfFile:[platformSystemRootDirectory() stringByAppendingPathComponent:@"System/Library/CoreServices/SystemVersion.plist"]]);
    4848    NSString *productVersion = [systemInfo objectForKey:@"ProductVersion"];
    4949    return !productVersion ? @"" : [productVersion stringByReplacingOccurrencesOfString:@"." withString:@"_"];
  • trunk/Source/WebKit2/ChangeLog

    r165409 r165412  
     12014-03-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix three leaks
     4        https://bugs.webkit.org/show_bug.cgi?id=130048
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
     9        (decodeObject): Code is simpler and less leaky without the RetainPtr.
     10        * UIProcess/API/Cocoa/WKNavigationAction.mm: Fix _originalURL leak
     11        by making it a RetainPtr and implementing the getter and setter.
     12        (-[WKNavigationAction _setOriginalURL:]):
     13        (-[WKNavigationAction _originalURL]):
     14
    1152014-03-10  Beth Dakin  <bdakin@apple.com>
    216
  • trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm

    r163470 r165412  
    498498        return decodeInvocation(decoder);
    499499
    500     RetainPtr<id> result = [objectClass allocWithZone:decoder.zone];
     500    id result = [objectClass allocWithZone:decoder.zone];
    501501    if (!result)
    502502        [NSException raise:NSInvalidUnarchiveOperationException format:@"Class \"%s\" returned nil from +alloc while being decoded", className.data()];
     
    510510        [NSException raise:NSInvalidUnarchiveOperationException format:@"Object of class \"%s\" returned nil from -awakeAfterUsingCoder: while being decoded", className.data()];
    511511
    512     return [result.leakRef() autorelease];
     512    return [result autorelease];
    513513}
    514514
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm

    r164300 r165412  
    3535    RetainPtr<WKFrameInfo> _destinationFrame;
    3636    RetainPtr<NSURLRequest> _request;
     37    RetainPtr<NSURL> _originalURL;
    3738}
    3839
     
    7374}
    7475
     76- (void)_setOriginalURL:(NSURL *)originalURL
     77{
     78    _originalURL = adoptNS([originalURL copy]);
     79}
     80
     81- (NSURL *)_originalURL
     82{
     83    return _originalURL.get();
     84}
     85
    7586@end
    7687
Note: See TracChangeset for help on using the changeset viewer.