WebKit Bugzilla
Attachment 341026 Details for
Bug 185887
: Fix issues with -dealloc methods found by clang static analyzer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v1
bug-185887-20180522142310.patch (text/plain), 15.97 KB, created by
David Kilzer (:ddkilzer)
on 2018-05-22 14:23:10 PDT
(
hide
)
Description:
Patch v1
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2018-05-22 14:23:10 PDT
Size:
15.97 KB
patch
obsolete
>Subversion Revision: 231940 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index e26319ea6ae19a809084d25afc1e1bf757377ed5..c392f10016bbc7f3616314044eb22b8db659e6fc 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-05-22 David Kilzer <ddkilzer@apple.com> >+ >+ Fix issues with -dealloc methods found by clang static analyzer >+ <https://webkit.org/b/185887> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * API/JSValue.mm: >+ (-[JSValue dealloc]): >+ (-[JSValue description]): >+ - Move method implementations from (Internal) category to the >+ main category since these are public API. This fixes the >+ false positive warning about a missing -dealloc method. >+ > 2018-05-17 Michael Saboff <msaboff@apple.com> > > We don't throw SyntaxErrors for runtime generated regular expressions with errors >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 385dd61ab755a5d049b333bcb2ce9f0b359a9764..3af2c1509a0cf72d87321676f862ec48095613fa 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2018-05-22 David Kilzer <ddkilzer@apple.com> >+ >+ Fix issues with -dealloc methods found by clang static analyzer >+ <https://webkit.org/b/185887> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/ios/WebAVPlayerController.mm: >+ (-[WebAVPlayerController dealloc]): Release `_minTiming` and >+ `_maxTiming` to fix leaks. >+ * platform/ios/WebBackgroundTaskController.mm: >+ (-[WebBackgroundTaskController dealloc]): Release >+ `_backgroundTaskStartBlock` and `_backgroundTaskEndBlock` to fix >+ leaks. >+ * platform/ios/WebItemProviderPasteboard.mm: >+ (-[WebItemProviderRegistrationInfoList dealloc]): Release >+ `_teamData` to fix leak. >+ > 2018-05-17 David Kilzer <ddkilzer@apple.com> > > Lazily create WebCore::Timer for WebCore::Image >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4068cc976f3ac30a1c4ab69beba0a33be62320c0..5f616a82f5b03e85a86767843a055e4aa55219c1 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,40 @@ >+2018-05-22 David Kilzer <ddkilzer@apple.com> >+ >+ Fix issues with -dealloc methods found by clang static analyzer >+ <https://webkit.org/b/185887> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: >+ (-[_WKPreviewControllerDataSource initWithMIMEType:]): Drive-by >+ fix to use `instancetype` instead of `id`. >+ (-[_WKPreviewControllerDataSource dealloc]): Add. Release >+ `_completionHandler` and `_mimeType` to fix leaks. >+ * UIProcess/ios/WKPasswordView.mm: >+ (-[WKPasswordView dealloc]): Add. Release >+ `_userDidEnterPassword` to fix leak. >+ * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: >+ (-[WKFullScreenViewController dealloc]): Release `_target` and >+ `_location` to fix leaks. >+ * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: >+ (-[WKFullscreenAnimationController dealloc]): Add. Release >+ `_viewController` to fix leak. >+ * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: >+ (@property secondaryMaterialOverlayView): Mark explicitly as >+ `assign` since this isn't a retained variable. >+ (@property secondaryMaterialOverlayViewConstraints): Mark >+ explicitly as `retain` since there is nothing to keep this >+ object alive. >+ (+[WKFullscreenStackView secondaryMaterialOverlayView]): Fix >+ leak by autoreleasing the return value. >+ (-[WKFullscreenStackView dealloc]): Release retained instance >+ variables to fix leaks. Note that `_stackView` and >+ `_visualEffectView` are internally retained despite their >+ @property declarations. >+ (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]): >+ Retain @property targetViewForSecondaryMaterialOverlay to match >+ its declaration. >+ > 2018-05-17 Nan Wang <n_wang@apple.com> > > AX: [macOS] Expose the primary screen height through AX API >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index eb48da8586ce753ed9b7a8e858f5bffdc0308520..72411d1c1895e827fbb445290153ff140e916396 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,17 @@ >+2018-05-22 David Kilzer <ddkilzer@apple.com> >+ >+ Fix issues with -dealloc methods found by clang static analyzer >+ <https://webkit.org/b/185887> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebView/WebView.mm: >+ (-[WebUITextIndicatorData dealloc]): >+ - Move method implementation from (WebUITextIndicatorInternal) >+ category to the main category since this is public API. This >+ fixes the false positive warning about a missing -dealloc >+ method. >+ > 2018-05-16 Andy VanWagoner <andy@vanwagoner.family> > > Add support for Intl NumberFormat formatToParts >diff --git a/Source/JavaScriptCore/API/JSValue.mm b/Source/JavaScriptCore/API/JSValue.mm >index e8ad52ef43f7f830a12e2d1f3c484cc05e539b4c..e7e329cafb989fbc0bcdec0b30bdaa73bfed2164 100644 >--- a/Source/JavaScriptCore/API/JSValue.mm >+++ b/Source/JavaScriptCore/API/JSValue.mm >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -66,6 +66,21 @@ @implementation JSValue { > JSValueRef m_value; > } > >+- (void)dealloc >+{ >+ JSValueUnprotect([_context JSGlobalContextRef], m_value); >+ [_context release]; >+ _context = nil; >+ [super dealloc]; >+} >+ >+- (NSString *)description >+{ >+ if (id wrapped = tryUnwrapObjcObject([_context JSGlobalContextRef], m_value)) >+ return [wrapped description]; >+ return [self toString]; >+} >+ > - (JSValueRef)JSValueRef > { > return m_value; >@@ -1138,21 +1153,6 @@ + (SEL)selectorForValueToStruct:(const char *)structTag > return handler ? handler->valueToTypeSEL : nil; > } > >-- (void)dealloc >-{ >- JSValueUnprotect([_context JSGlobalContextRef], m_value); >- [_context release]; >- _context = nil; >- [super dealloc]; >-} >- >-- (NSString *)description >-{ >- if (id wrapped = tryUnwrapObjcObject([_context JSGlobalContextRef], m_value)) >- return [wrapped description]; >- return [self toString]; >-} >- > NSInvocation *typeToValueInvocationFor(const char* encodedType) > { > SEL selector = [JSValue selectorForStructToValue:encodedType]; >diff --git a/Source/WebCore/platform/ios/WebAVPlayerController.mm b/Source/WebCore/platform/ios/WebAVPlayerController.mm >index 0d0173e85965d8e5e4b243596b0fda4a112814c9..84814233e8d4f84e3da5374574fb1ad53e7e94bd 100644 >--- a/Source/WebCore/platform/ios/WebAVPlayerController.mm >+++ b/Source/WebCore/platform/ios/WebAVPlayerController.mm >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014, 2015 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -90,6 +90,8 @@ - (void)dealloc > [_currentAudioMediaSelectionOption release]; > [_currentLegibleMediaSelectionOption release]; > [_externalPlaybackAirPlayDeviceLocalizedName release]; >+ [_minTiming release]; >+ [_maxTiming release]; > [super dealloc]; > } > >diff --git a/Source/WebCore/platform/ios/WebBackgroundTaskController.mm b/Source/WebCore/platform/ios/WebBackgroundTaskController.mm >index f3c48387dc34a66944d1b605699c34be2da42d37..d47e9fadadb10f4423c0f439def3567741c075dd 100644 >--- a/Source/WebCore/platform/ios/WebBackgroundTaskController.mm >+++ b/Source/WebCore/platform/ios/WebBackgroundTaskController.mm >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -40,6 +40,8 @@ + (WebBackgroundTaskController *)sharedController > > - (void)dealloc > { >+ [_backgroundTaskStartBlock release]; >+ [_backgroundTaskEndBlock release]; > [super dealloc]; > } > >diff --git a/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm b/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm >index 6eb38e91221e9366e6e23b9b4898012276b70088..332dead624f5dbf56d1fd371871fa909efdd68de 100644 >--- a/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm >+++ b/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -214,6 +214,7 @@ - (instancetype)init > - (void)dealloc > { > [_suggestedName release]; >+ [_teamData release]; > [super dealloc]; > } > >diff --git a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >index 3f4e9d54bcd7663fd4480d1653f150910e8d362a..da543715ad19bb0570f730a4a64d9a96cda86d65 100644 >--- a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >@@ -57,7 +57,7 @@ @end > > @implementation _WKPreviewControllerDataSource > >-- (id)initWithMIMEType:(NSString*)mimeType >+- (instancetype)initWithMIMEType:(NSString*)mimeType > { > if (!(self = [super init])) > return nil; >@@ -67,6 +67,13 @@ - (id)initWithMIMEType:(NSString*)mimeType > return self; > } > >+- (void)dealloc >+{ >+ [_completionHandler release]; >+ [_mimeType release]; >+ [super dealloc]; >+} >+ > - (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller > { > return 1; >diff --git a/Source/WebKit/UIProcess/ios/WKPasswordView.mm b/Source/WebKit/UIProcess/ios/WKPasswordView.mm >index f2719a3ad71235318d9907d512f76e07fb2f384b..475d63cebec0726aba91f8251fc38aa43d5d5c37 100644 >--- a/Source/WebKit/UIProcess/ios/WKPasswordView.mm >+++ b/Source/WebKit/UIProcess/ios/WKPasswordView.mm >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -69,6 +69,12 @@ - (instancetype)initWithFrame:(CGRect)frame documentName:(NSString *)documentNam > return self; > } > >+- (void)dealloc >+{ >+ [_userDidEnterPassword release]; >+ [super dealloc]; >+} >+ > - (NSString *)documentName > { > return _documentName.get(); >diff --git a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm >index 0c7d48db3157374091cdd59ded4f69cc8912a935..6710ae062b5b129de9056cbfd9217746a86fe707 100644 >--- a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm >+++ b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm >@@ -148,6 +148,9 @@ - (void)dealloc > > _playbackClient.setInterface(nullptr); > >+ [_target release]; >+ [_location release]; >+ > [super dealloc]; > } > >diff --git a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm >index d2f5f18ddb63b5af5b6791e7d4085fd2c75043ff..4c7fb8a379955beffea1e346f5785ba06a65bc0f 100644 >--- a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm >+++ b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -148,6 +148,12 @@ @implementation WKFullscreenAnimationController { > CGFloat _finalBackgroundAlpha; > } > >+- (void)dealloc >+{ >+ [_viewController release]; >+ [super dealloc]; >+} >+ > - (void)_createViewsForTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext > { > _maskView = adoptNS([[UIView alloc] init]); >diff --git a/Source/WebKit/UIProcess/ios/fullscreen/WKFullscreenStackView.mm b/Source/WebKit/UIProcess/ios/fullscreen/WKFullscreenStackView.mm >index f1a11b5a2703839874ba26e4f87bd07709f03049..d17a7e8849349dd07f349323af5169f5cbc9e57f 100644 >--- a/Source/WebKit/UIProcess/ios/fullscreen/WKFullscreenStackView.mm >+++ b/Source/WebKit/UIProcess/ios/fullscreen/WKFullscreenStackView.mm >@@ -66,8 +66,8 @@ @end > @interface WKFullscreenStackView () > @property (nonatomic, readonly) UIStackView *_stackView; > @property (nonatomic, readonly) UIVisualEffectView *_visualEffectView; >-@property (nonatomic) UIVisualEffectView *secondaryMaterialOverlayView; >-@property (nonatomic) NSArray<NSLayoutConstraint *> *secondaryMaterialOverlayViewConstraints; >+@property (nonatomic, assign) UIVisualEffectView *secondaryMaterialOverlayView; >+@property (nonatomic, retain) NSArray<NSLayoutConstraint *> *secondaryMaterialOverlayViewConstraints; > @end > > @implementation WKFullscreenStackView >@@ -104,7 +104,7 @@ + (UIVisualEffectView *)secondaryMaterialOverlayView > UIVisualEffectView *secondaryMaterialOverlayView = [[UIVisualEffectView alloc] initWithEffect:nil]; > [secondaryMaterialOverlayView setUserInteractionEnabled:NO]; > [secondaryMaterialOverlayView setBackgroundEffects:@[[UIVisualEffect effectCompositingColor:[UIColor blackColor] withMode:UICompositingModePlusDarker alpha:0.06]]]; >- return secondaryMaterialOverlayView; >+ return [secondaryMaterialOverlayView autorelease]; > } > > #pragma mark - External Interface >@@ -143,12 +143,21 @@ - (instancetype)initWithArrangedSubviews:(NSArray<UIView *> *)arrangedSubviews a > return self; > } > >+- (void)dealloc >+{ >+ [_targetViewForSecondaryMaterialOverlay release]; >+ [_visualEffectView release]; >+ [_stackView release]; >+ [_secondaryMaterialOverlayViewConstraints release]; >+ [super dealloc]; >+} >+ > - (void)setTargetViewForSecondaryMaterialOverlay:(UIView *)targetViewForSecondaryMaterialOverlay > { > if (_targetViewForSecondaryMaterialOverlay == targetViewForSecondaryMaterialOverlay) > return; > >- _targetViewForSecondaryMaterialOverlay = targetViewForSecondaryMaterialOverlay; >+ _targetViewForSecondaryMaterialOverlay = [targetViewForSecondaryMaterialOverlay retain]; > [self setNeedsUpdateConstraints]; > } > >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index ff1c0186b8a2e5e6816b0b643b2aa19629d272e1..a76e33a20fb09d92b0cf315bc51f6e482c266e5b 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -660,6 +660,18 @@ @synthesize contentImageWithoutSelectionRectInRootViewCoordinates=_contentImageW > @synthesize contentImage=_contentImage; > @synthesize estimatedBackgroundColor=_estimatedBackgroundColor; > >+- (void)dealloc >+{ >+ [_dataInteractionImage release]; >+ [_textRectsInBoundingRectCoordinates release]; >+ [_contentImageWithHighlight release]; >+ [_contentImageWithoutSelection release]; >+ [_contentImage release]; >+ [_estimatedBackgroundColor release]; >+ >+ [super dealloc]; >+} >+ > @end > > @implementation WebUITextIndicatorData (WebUITextIndicatorInternal) >@@ -707,18 +719,6 @@ - (WebUITextIndicatorData *)initWithImage:(CGImageRef)image scale:(CGFloat)scale > return self; > } > >-- (void)dealloc >-{ >- [_dataInteractionImage release]; >- [_textRectsInBoundingRectCoordinates release]; >- [_contentImageWithHighlight release]; >- [_contentImageWithoutSelection release]; >- [_contentImage release]; >- [_estimatedBackgroundColor release]; >- >- [super dealloc]; >-} >- > @end > #elif !PLATFORM(MAC) > @implementation WebUITextIndicatorData
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185887
: 341026 |
341048
|
341109