Bug 14761 - Web Inspector leaks JS objects and DOM nodes
Summary: Web Inspector leaks JS objects and DOM nodes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Critical
Assignee: Timothy Hatcher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-24 22:01 PDT by John Moe
Modified: 2007-11-15 22:16 PST (History)
2 users (show)

See Also:


Attachments
Patch (1.72 KB, patch)
2007-11-15 22:04 PST, Timothy Hatcher
mrowe: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Moe 2007-07-24 22:01:48 PDT
Open any page, right click Inspect Element, close both windows.  Lots of items will not be garbage collected (heap.numLiveObjects will be large).  You can repeat and the number will continue to grow.


InspectorController::m_scriptObject is never unprotected, because the call to JSObjectSetPrivate() in the InspectorController destructor causes unloading() to never call windowUnloading(). 


A Fix:
In InspectorController.cpp, InspectorController destructor, move:
    m_client->inspectorDestroyed();

before:
    if (m_scriptContext) {

and remove:
    m_client->closeWindow();

It seems to fix the leak and things seem to still work, but I've been playing with the WebKit code for less than a day, so who knows?
Comment 1 Timothy Hatcher 2007-11-15 22:04:04 PST
Created attachment 17312 [details]
Patch
Comment 2 Mark Rowe (bdash) 2007-11-15 22:12:46 PST
Comment on attachment 17312 [details]
Patch

r=me, but "Zero" should be "zero" in the changelog.
Comment 3 Timothy Hatcher 2007-11-15 22:16:17 PST
Landed in r27839. http://trac.webkit.org/projects/webkit/changeset/27839