Bug 210711

Summary: REGRESSION (r259610): Leak of RBSAssertionInvalidationCallbackType due to missing -dealloc
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: WebKit2Assignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, ggaren, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 210065    
Bug Blocks:    
Attachments:
Description Flags
Patch v1
none
Patch for landing
none
Patch for landing v2 none

Description David Kilzer (:ddkilzer) 2020-04-18 19:42:13 PDT
Leak of RBSAssertionInvalidationCallbackType due to missing -dealloc.

Found by clang static analyzer:

'WKRBSAssertionDelegate' lacks a 'dealloc' instance method but must release '_invalidationCallback'

Regressed with the fix for Bug 210065 in r259610:

Bug 196659: [iOS] Transition most process assertions to RunningBoard
<https://bugs.webkit.org/show_bug.cgi?id=210065>
<rdar://problem/61354901>
<https://trac.webkit.org/r259610>
Comment 1 Radar WebKit Bug Importer 2020-04-18 19:43:32 PDT
<rdar://problem/61993361>
Comment 2 David Kilzer (:ddkilzer) 2020-04-18 19:44:56 PDT
Created attachment 396889 [details]
Patch v1
Comment 3 David Kilzer (:ddkilzer) 2020-04-18 19:45:26 PDT
Comment on attachment 396889 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=396889&action=review

> Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm:275
> +- (void)dealloc

I chose to implement dealloc because using RetainPtr<> would require an instance variable and a custom getter (and maybe a setter).

When switching to ARC, we simply delete the -dealloc method and the @property will work as expected.
Comment 4 Geoffrey Garen 2020-04-19 17:45:30 PDT
Comment on attachment 396889 [details]
Patch v1

r=me
Comment 5 David Kilzer (:ddkilzer) 2020-04-19 18:58:11 PDT
Created attachment 396933 [details]
Patch for landing
Comment 6 David Kilzer (:ddkilzer) 2020-04-19 19:01:31 PDT
Created attachment 396934 [details]
Patch for landing v2
Comment 7 EWS 2020-04-19 20:54:31 PDT
Found 1 new test failure: fast/layoutformattingcontext/simple-absolute-positioned-replaced-inline-element-with-percentage-height.html
Comment 8 EWS 2020-04-20 00:11:33 PDT
Committed r260354: <https://trac.webkit.org/changeset/260354>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 396934 [details].