Closed Bug 637116 Opened 13 years ago Closed 13 years ago

Leak documents+windows with replaceState, focus, event handler closure

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: peterv)

References

Details

(Keywords: memory-leak, testcase)

Attachments

(2 files, 2 obsolete files)

Attached file testcase
This convoluted testcase causes nsGlobalWindow and nsDocument objects to leak.

It has something in common with the testcase in bug 630801: passing a weird throwing object to pushState.  So maybe the bugs are related.
OS: Mac OS X → All
Hardware: x86 → All
Somehow the exception isn't showing up in the cycle collector.
Assignee: nobody → peterv
Attached patch v1 (obsolete) — Splinter Review
We need to propagate the exception from parsing the JSON in nsDocShell::StringifyJSValVariant to the caller of nsHistory::PushState. Jst, mrbkap, any idea if there's a cleaner way to do this?
So, jst and I talked about this very patch when I was looking at bug 623850. The reason we didn't go with it is that it's possible that the top context on the context stack is unrelated to the actual caller. IMO it'd be safer (for now) to clear the pending exception and return NS_ERROR_FAILURE. That way, we'll lose the exception that was thrown, but we will preserve that *an* error was thrown, and we won't leak.
Attached patch v2 (obsolete) — Splinter Review
Attachment #517485 - Attachment is obsolete: true
Attached patch v2Splinter Review
Attachment #523201 - Attachment is obsolete: true
Attachment #523436 - Flags: review?(mrbkap)
Comment on attachment 523436 [details] [diff] [review]
v2

r=me after changing the IIDs for the interfaces that you added [implicit_context] markings to.
Attachment #523436 - Flags: review?(mrbkap) → review+
http://hg.mozilla.org/mozilla-central/rev/a0adf7f6b4bd
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: