Bug 39973
Summary: | Memory Leak: The main resource of page is not free. | ||
---|---|---|---|
Product: | WebKit | Reporter: | genhua.liu <genhua.liu> |
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Critical | CC: | xan.lopez |
Priority: | P1 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | Linux |
genhua.liu
The leak is happen in ./WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp:
void FrameLoadedrClient::dispatchDidFinishLoading(...)
if(!coreResource)
coreResource = loader->mainResource().releaseRef();
should be as following:
if(!coreResource)
coreResource = loader->mainResource();
Otherwise, the reference count of coreResource is 2 at this point. And the main resource will not freed in this case.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Xan Lopez
(In reply to comment #0)
> The leak is happen in ./WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp:
> void FrameLoadedrClient::dispatchDidFinishLoading(...)
>
> if(!coreResource)
> coreResource = loader->mainResource().releaseRef();
>
> should be as following:
>
> if(!coreResource)
> coreResource = loader->mainResource();
>
> Otherwise, the reference count of coreResource is 2 at this point. And the main resource will not freed in this case.
If I recall the refptr stuff correctly, I think this is right. The object is created with 1 reference, then it's increased to 2 for the return value. As we leak the ref with releaseRef(), it's never decreased to 1 when assigned. Is this what you had in mind?
Xan Lopez
Pushed as r60498