Bug 59705

Summary: WTF::postTimer() leaks a CFRunLoopTimerRef every time it's called
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Web Template FrameworkAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED INVALID    
Severity: Normal CC: darin, dimich, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on: 35943    
Bug Blocks:    
Attachments:
Description Flags
Patch simon.fraser: review+

Description David Kilzer (:ddkilzer) 2011-04-28 09:19:28 PDT
Created attachment 91502 [details]
Patch

Reviewed by NOBODY (OOPS!).

* wtf/mac/MainThreadMac.mm:
(WTF::postTimer): Use RetainPtr to plug the leak.
---
 2 files changed, 12 insertions(+), 1 deletions(-)
Comment 1 Simon Fraser (smfr) 2011-04-28 09:20:53 PDT
Comment on attachment 91502 [details]
Patch

Good catch!
Comment 2 WebKit Review Bot 2011-04-28 09:21:53 PDT
Attachment 91502 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1

Source/JavaScriptCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 David Kilzer (:ddkilzer) 2011-04-28 09:22:25 PDT
This regressed in r55816 for Bug 35943.  <http://trac.webkit.org/changeset/55816>
Comment 4 David Kilzer (:ddkilzer) 2011-04-28 09:40:38 PDT
Committed r85195: <http://trac.webkit.org/changeset/85195>
Comment 5 David Kilzer (:ddkilzer) 2011-04-28 16:54:53 PDT
This needs to be rolled out.  It causes crashes on Lion.
Comment 6 David Kilzer (:ddkilzer) 2011-04-28 16:56:02 PDT
<rdar://problem/9355811>
Comment 7 Darin Adler 2011-04-28 17:00:07 PDT
Comment on attachment 91502 [details]
Patch

I don’t think this fix is correct. The timerFired function releases the timer when it fires, so as far as I can tell there is no leak here.
Comment 8 David Kilzer (:ddkilzer) 2011-04-28 17:07:57 PDT
(In reply to comment #7)
> (From update of attachment 91502 [details])
> I don’t think this fix is correct. The timerFired function releases the timer when it fires, so as far as I can tell there is no leak here.

Ahh...that's kind of strange, but it works.

Rolled out in r85265.  <http://trac.webkit.org/changeset/85265>

Closing as RESOLVED/INVALID.