Closed Bug 352911 Opened 18 years ago Closed 18 years ago

leak when closing window while it contains a google maps page (missing ClearScope on outer window)

Categories

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

x86
Linux
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: dbaron, Assigned: dbaron)

References

()

Details

(Keywords: memory-leak, regression, Whiteboard: [patch])

Attachments

(1 file)

I'm seeing major leaks, I think because JS_ClearScope and perhaps some other cleanup code is missing from one of the window teardown paths. Steps to reproduce: 1. start firefox 2. load http://dbaron.org/maps/geotagged-photos 3. close the window Actual results: the document and both the inner and outer windows leak Note that if you navigate to a different page between (2) and (3), there's no leak. The leak seems to be due to a cycle that should have been broken by a JS_ClearScope: 0a4de740 object 0xa502a68 HTMLDocument via locked object(Window @ 0x0a4de230).XPCWrappedNative::mNativeWrapper(XPCNativeWrapper @ 0x0a4de798).__proto__(XPCNativeWrapper @ 0x0a4de328).__parent__(Window @ 0x0a23fa18).GLoadApi(Function @ 0x0a720d58).__parent__(Call @ 0x0a720ae0).__proto__(Call @ 0x0a720ad8).arguments(Object @ 0x0a82e660).0(Object @ 0x0aab1840).photos(Array @ 0x0aab1848).0(Object @ 0x0a507338).marker(Object @ 0x0a8b1618).a(Object @ 0x0a507780).b(HTMLDivElement @ 0x0a507768).nsDOMClassInfo::sPreservedWrapperTable(HTMLImageElement @ 0x0a7bbec8).__parent__(HTMLDocument @ 0x0a4de740).
This is a regression *since* the 1.8 branch.
Keywords: regression
Attached patch patchSplinter Review
This fixes the leak, and I think it does what was intended here. Instead of repeating the clearing of the inner window's global that was just done in FreeInnerObjects, this clears the outer window's global.
Assignee: general → dbaron
Status: NEW → ASSIGNED
Attachment #238723 - Flags: superreview?(jst)
Attachment #238723 - Flags: review?(mhammond)
Summary: leak when closing window while it contains a google maps page → leak when closing window while it contains a google maps page (missing ClearScope on outer window)
Comment on attachment 238723 [details] [diff] [review] patch sr=jst
Attachment #238723 - Flags: superreview?(jst) → superreview+
Comment on attachment 238723 [details] [diff] [review] patch Oh, but please do pull this code up to the previous line now that it fits.
All 3 lines even fit on one now!
Blocks: 343982
Comment on attachment 238723 [details] [diff] [review] patch yeah, it looks like I did get that confused.
Attachment #238723 - Flags: review?(mhammond) → review+
Checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9alpha
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: