WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
39973
Memory Leak: The main resource of page is not free.
https://bugs.webkit.org/show_bug.cgi?id=39973
Summary
Memory Leak: The main resource of page is not free.
genhua.liu
Reported
2010-05-31 18:06:32 PDT
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
Comment 1
2010-06-01 11:56:27 PDT
(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
Comment 2
2010-06-01 12:21:44 PDT
Pushed as
r60498
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