Bug 25023 - [Qt]Eliminating a leak in QNetworkReplyHandler
Summary: [Qt]Eliminating a leak in QNetworkReplyHandler
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Major
Assignee: Nobody
URL:
Keywords:
: 26922 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-03 02:49 PDT by Tamas Szirbucz
Modified: 2010-03-16 06:06 PDT (History)
2 users (show)

See Also:


Attachments
proposed patch (1.22 KB, patch)
2009-04-03 02:52 PDT, Tamas Szirbucz
hausmann: review-
Details | Formatted Diff | Diff
proposed patch (1.05 KB, patch)
2009-04-08 05:49 PDT, Tamas Szirbucz
ariya.hidayat: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tamas Szirbucz 2009-04-03 02:49:56 PDT
We found that QNetworkReplyHandler::m_reply has never been freed in some
cases because QNetworkReplyHandler::release sets it to zero. Through that
the call of deleteLater on it in QNetworkRepyHandler is useless.
We did not see any problem when we had removed the problematic line.
Comment 1 Tamas Szirbucz 2009-04-03 02:52:35 PDT
Created attachment 29223 [details]
proposed patch
Comment 2 Simon Hausmann 2009-04-03 07:28:42 PDT
Comment on attachment 29223 [details]
proposed patch

I agree that there's probably a leak, but the purpose of release() is to transfer the ownership to the caller. If we don't reset m_reply to 0 a subsequent call to release() will return a pointer to the object whos ownership we transferred to the previous caller. In other words: I think the caller in abort() for example should call deleteLater on the reply(). Does that work for you?
Comment 3 Tamas Szirbucz 2009-04-08 05:48:24 PDT
Ops, sorry for the late response, this bug had got out of my mind.
You are absolute right, the solution is to simply call deleteLater on
reply in abort.
Comment 4 Tamas Szirbucz 2009-04-08 05:49:06 PDT
Created attachment 29330 [details]
proposed patch
Comment 5 Ariya Hidayat 2009-04-22 05:10:23 PDT
Landed in r42747. Thanks!
http://trac.webkit.org/changeset/42747
Comment 6 Balazs Kelemen 2010-03-16 06:06:41 PDT
*** Bug 26922 has been marked as a duplicate of this bug. ***