Changeset 214910 in webkit


Ignore:
Timestamp:
Apr 4, 2017 3:57:22 PM (7 years ago)
Author:
Megan Gardner
Message:

Fix leaks in WebUITextIndicatorData
https://bugs.webkit.org/show_bug.cgi?id=170480

Reviewed by Wenson Hsieh.

Removes extraneous retains.

  • WebView/WebView.mm:

(-[WebUITextIndicatorData initWithImage:textIndicatorData:scale:]):

Location:
trunk/Source/WebKit/mac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r214893 r214910  
     12017-04-04  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Fix leaks in WebUITextIndicatorData
     4        https://bugs.webkit.org/show_bug.cgi?id=170480
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        Removes extraneous retains.
     9
     10        * WebView/WebView.mm:
     11        (-[WebUITextIndicatorData initWithImage:textIndicatorData:scale:]):
     12
    1132017-04-04  Tim Horton  <timothy_horton@apple.com>
    214
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r214893 r214910  
    650650        return nil;
    651651   
    652     _dataInteractionImage = [[[getUIImageClass() alloc] initWithCGImage:image scale:scale orientation:UIImageOrientationDownMirrored] retain];
     652    _dataInteractionImage = [[getUIImageClass() alloc] initWithCGImage:image scale:scale orientation:UIImageOrientationDownMirrored];
    653653    _selectionRectInRootViewCoordinates = indicatorData.selectionRectInRootViewCoordinates;
    654654    _textBoundingRectInRootViewCoordinates = indicatorData.textBoundingRectInRootViewCoordinates;
     
    660660    _contentImageScaleFactor = indicatorData.contentImageScaleFactor;
    661661    if (indicatorData.contentImageWithHighlight)
    662         _contentImageWithHighlight = [[[getUIImageClass() alloc] initWithCGImage:indicatorData.contentImageWithHighlight.get()->nativeImage().get() scale:scale orientation:UIImageOrientationDownMirrored] retain];
     662        _contentImageWithHighlight = [[getUIImageClass() alloc] initWithCGImage:indicatorData.contentImageWithHighlight.get()->nativeImage().get() scale:scale orientation:UIImageOrientationDownMirrored];
    663663    if (indicatorData.contentImage)
    664         _contentImage = [[[getUIImageClass() alloc] initWithCGImage:indicatorData.contentImage.get()->nativeImage().get() scale:scale orientation:UIImageOrientationUp] retain];
     664        _contentImage = [[getUIImageClass() alloc] initWithCGImage:indicatorData.contentImage.get()->nativeImage().get() scale:scale orientation:UIImageOrientationUp];
    665665
    666666    if (indicatorData.contentImageWithoutSelection) {
    667667        auto nativeImage = indicatorData.contentImageWithoutSelection.get()->nativeImage();
    668668        if (nativeImage) {
    669             _contentImageWithoutSelection = [[[getUIImageClass() alloc] initWithCGImage:nativeImage.get() scale:scale orientation:UIImageOrientationUp] retain];
     669            _contentImageWithoutSelection = [[getUIImageClass() alloc] initWithCGImage:nativeImage.get() scale:scale orientation:UIImageOrientationUp];
    670670            _contentImageWithoutSelectionRectInRootViewCoordinates = indicatorData.contentImageWithoutSelectionRectInRootViewCoordinates;
    671671        }
     
    673673
    674674    if (indicatorData.options & TextIndicatorOptionComputeEstimatedBackgroundColor)
    675         _estimatedBackgroundColor = [[[getUIColorClass() alloc] initWithCGColor:cachedCGColor(indicatorData.estimatedBackgroundColor)] retain];
     675        _estimatedBackgroundColor = [[getUIColorClass() alloc] initWithCGColor:cachedCGColor(indicatorData.estimatedBackgroundColor)];
    676676
    677677    return self;
Note: See TracChangeset for help on using the changeset viewer.