Bug 210658

Summary: REGRESSION (r234105): [iOS] WKColorButton leaks a UIColor
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: WebKit2Assignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, darin, esprehn+autocc, ews-watchlist, gyuyoung.kim, mifenton, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 187871    
Bug Blocks:    
Attachments:
Description Flags
Patch v1
none
Patch for landing none

David Kilzer (:ddkilzer)
Reported 2020-04-17 09:26:21 PDT
WKColorButton leaks a UIColor. Found by clang static analyzer: 'WKColorButton' lacks a 'dealloc' instance method but must release '_color' -- #pragma mark - WKColorButton @interface WKColorButton : UIButton @property (nonatomic, strong) UIColor *color; + (instancetype)colorButtonWithColor:(UIColor *)color; @end @implementation WKColorButton + (instancetype)colorButtonWithColor:(UIColor *)color { WKColorButton *colorButton = [WKColorButton buttonWithType:UIButtonTypeCustom]; colorButton.color = color; colorButton.backgroundColor = color; return colorButton; } @end
Attachments
Patch v1 (3.25 KB, patch)
2020-04-17 09:31 PDT, David Kilzer (:ddkilzer)
no flags
Patch for landing (3.27 KB, patch)
2020-04-17 14:42 PDT, David Kilzer (:ddkilzer)
no flags
Radar WebKit Bug Importer
Comment 1 2020-04-17 09:27:32 PDT
David Kilzer (:ddkilzer)
Comment 2 2020-04-17 09:31:30 PDT
Created attachment 396770 [details] Patch v1
Darin Adler
Comment 3 2020-04-17 10:15:28 PDT
Comment on attachment 396770 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=396770&action=review > Source/WebCore/page/Chrome.cpp:428 > #if PLATFORM(IOS_FAMILY) > return nullptr; > -#endif > +#else > notifyPopupOpeningObservers(); > return m_client.createColorChooser(client, initialColor); > +#endif We need UNUSED_PARAM here. I also think the "always-null color chooser" design strategy is a little messy, but that goes beyond this function
David Kilzer (:ddkilzer)
Comment 4 2020-04-17 14:42:16 PDT
Created attachment 396803 [details] Patch for landing
EWS
Comment 5 2020-04-17 15:08:36 PDT
Committed r260290: <https://trac.webkit.org/changeset/260290> All reviewed patches have been landed. Closing bug and clearing flags on attachment 396803 [details].
Note You need to log in before you can comment on or make changes to this bug.