WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
65790
[QT] Possible Leaks WKRetainPtr<> should Adopt allocated Copy
https://bugs.webkit.org/show_bug.cgi?id=65790
Summary
[QT] Possible Leaks WKRetainPtr<> should Adopt allocated Copy
Joseph Pecoraro
Reported
2011-08-05 14:18:48 PDT
shell> cd Source/ shell> a 'Retain.*?=.*?Copy' WebKit2/UIProcess/API/qt/qweberror.cpp 61: WKRetainPtr<WKStringRef> errorDomainPtr = adoptWK(WKErrorCopyDomain(d->error.get())); 80: WKRetainPtr<WKURLRef> failingURL = adoptWK(WKErrorCopyFailingURL(d->error.get())); WebKit2/UIProcess/qt/qwkhistory.cpp 76: WKRetainPtr<WKStringRef> title = WKBackForwardListItemCopyTitle(d->m_backForwardListItem.get()); 84: WKRetainPtr<WKURLRef> url = WKBackForwardListItemCopyURL(d->m_backForwardListItem.get()); These look like possible leaks. Since WKRetainPtr::operator= does a WKRetain and typically a WK*Copy*() will return a +1 allocation. I think the correct behavior here would be AdoptWK like: WebKit2/UIProcess/qt/qwkpreferences.cpp 93: WKRetainPtr<WKStringRef> stringRef(AdoptWK, WKPreferencesCopyStandardFontFamily(d->ref));
Attachments
[PATCH] Untested Proposed Fix
(1.63 KB, patch)
2011-08-05 14:25 PDT
,
Joseph Pecoraro
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Joseph Pecoraro
Comment 1
2011-08-05 14:20:09 PDT
I should clarify.
> WebKit2/UIProcess/API/qt/qweberror.cpp > 61: WKRetainPtr<WKStringRef> errorDomainPtr = adoptWK(WKErrorCopyDomain(d->error.get())); > 80: WKRetainPtr<WKURLRef> failingURL = adoptWK(WKErrorCopyFailingURL(d->error.get()));
These look good because of the adoptWK(...).
> WebKit2/UIProcess/qt/qwkhistory.cpp > 76: WKRetainPtr<WKStringRef> title = WKBackForwardListItemCopyTitle(d->m_backForwardListItem.get()); > 84: WKRetainPtr<WKURLRef> url = WKBackForwardListItemCopyURL(d->m_backForwardListItem.get());
These however don't look so good.
Joseph Pecoraro
Comment 2
2011-08-05 14:25:16 PDT
Created
attachment 103114
[details]
[PATCH] Untested Proposed Fix I haven't tested this patch so I really suggest a WebKit2 / Qt developer take a look at this. I did not do a Qt build to test this, I just inspected the source.
WebKit Review Bot
Comment 3
2011-08-07 12:42:36 PDT
Comment on
attachment 103114
[details]
[PATCH] Untested Proposed Fix Clearing flags on attachment: 103114 Committed
r92574
: <
http://trac.webkit.org/changeset/92574
>
WebKit Review Bot
Comment 4
2011-08-07 12:42:40 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug