Bug 6158

Summary: Fix leaks in PassRefPtr
Product: WebKit Reporter: Maciej Stachowiak <mjs>
Component: WebKit Misc.Assignee: Maciej Stachowiak <mjs>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
fix the problems
none
fix problem with last attachment darin: review+

Maciej Stachowiak
Reported 2005-12-20 02:43:11 PST
There's two problems with PassRefPtr that can cause memory problems: 1) The RefPtr assignment from PassRefPtr has an extra ref 2) PassRefPtr doesn't declare a copy constructor, this means the default is used and that doesn't properly transfer ownership.
Attachments
fix the problems (12.61 KB, patch)
2005-12-20 02:44 PST, Maciej Stachowiak
no flags
fix problem with last attachment (13.02 KB, patch)
2005-12-20 04:20 PST, Maciej Stachowiak
darin: review+
Maciej Stachowiak
Comment 1 2005-12-20 02:44:28 PST
Created attachment 5172 [details] fix the problems
Maciej Stachowiak
Comment 2 2005-12-20 04:20:50 PST
Created attachment 5177 [details] fix problem with last attachment First version had a bug and caused more leaks. This version is better.
Darin Adler
Comment 3 2005-12-20 09:11:56 PST
Comment on attachment 5177 [details] fix problem with last attachment I think pass should take a const RefPtr<T>& rather than a RefPtr<T> to avoid reference count churn. r=me
Maciej Stachowiak
Comment 4 2005-12-20 12:04:16 PST
OK, fixed it to take a const&
Note You need to log in before you can comment on or make changes to this bug.