Address some clang static analyzer warnings in WebKit
Issues being addressed: AnalyzeShallow WebFullScreenController.mm In file included from Source/WebKit/mac/WebView/WebFullScreenController.mm:28: Source/WebKit/mac/WebView/WebFullScreenController.h:58:10: warning: Instance variable '_isPlaying' in class 'WebFullScreenController' is never used by the methods in its @implementation (although it may be used by category methods) AnalyzeShallow WebImmediateActionController.mm In file included from Source/WebKit/mac/WebView/WebImmediateActionController.mm:26: Source/WebKit/mac/WebView/WebImmediateActionController.h:54:10: warning: Instance variable '_isShowingTextIndicator' in class 'WebImmediateActionController' is never used by the methods in its @implementation (although it may be used by category methods) AnalyzeShallow WebSelectionServiceController.mm Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm:83:36: warning: Potential leak of an object stored into 'attachment' Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm:85:34: warning: Potential leak of an object stored into 'cell' AnalyzeShallow WebSharingServicePickerController.mm Source/WebKit/mac/Misc/WebSharingServicePickerController.mm:169:32: warning: Potential leak of an object stored into 'services' --- AnalyzeShallow WebVideoFullscreenManagerProxy.mm Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:60:12: warning: Potential leak of an object AnalyzeShallow WKDOMRange.mm Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:150:12: warning: Potential leak of an object AnalyzeShallow WKSharingServicePickerDelegate.mm Source/WebKit2/UIProcess/mac/WKSharingServicePickerDelegate.mm:77:32: warning: Potential leak of an object stored into 'services'
Created attachment 287937 [details] [PATCH] Proposed Fix
Created attachment 287938 [details] [PATCH] Proposed Fix
Comment on attachment 287938 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=287938&action=review > Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm:87 > + RetainPtr<NSMutableAttributedString> attributedStringWithRichContent = (NSMutableAttributedString *)[NSMutableAttributedString attributedStringWithAttachment:attachment.get()]; I suggest we not use a RetainPtr here. NSMutableAttributedString *attributedStringWithRichContent = [NSMutableAttributedString attributedStringWithAttachment:attachment.get()]; > Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm:90 > bool hasRichContentServices = hasCompatibleServicesForItems(@[ attributedStringWithRichContent.get() ]); I suggest we not use a local variable here.
<https://trac.webkit.org/changeset/205592>