Closed Bug 443483 Opened 17 years ago Closed 16 years ago

Closed windows need two cycle collections to be collected

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: peterv, Assigned: peterv)

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 1 obsolete file)

Attached patch v1 (obsolete) — Splinter Review
I'm seeing windows stay alive through a cycle collection, even though they really can be collected. The cycle collector even considers them to be white (so they're in a cycle that has no outstanding references). I need to untangle my tree, but I think I have a fix: we're currently not collecting XPCWrappedJS objects that something holds a weak reference too. Fixing that seems to make the closed windows get collected by the next cycle collection.
Attached patch v2Splinter Review
Also need to collect nsTimeout objects.
Attachment #328030 - Attachment is obsolete: true
Still valid, peterv?
Comment on attachment 328322 [details] [diff] [review] v2 I'd forgotten about this, we should try to get this into 1.9.1.
Attachment #328322 - Flags: superreview?(jst)
Attachment #328322 - Flags: review?(bent.mozilla)
Comment on attachment 328322 [details] [diff] [review] v2 >+ cb.NoteNativeChild(timeout, &NS_CYCLE_COLLECTION_NAME(nsTimeout)); >+ } >+ >+ Nit: one too many empty lines here. > NS_IMPL_CYCLE_COLLECTION_ROOT_BEGIN(nsXPCWrappedJS) >- if(tmp->mRoot && !tmp->mRoot->HasWeakReferences() && tmp->IsValid()) >+ if(tmp->mRoot && tmp->IsValid()) It looks to me like mRoot can only ever be null if we've already called Unlink, in which case I wouldn't think it should be possible to end up in another call to Root. Can you remove that null check too? r=me.
Attachment #328322 - Flags: review?(bent.mozilla) → review+
Attachment #328322 - Flags: superreview?(jst) → superreview+
Priority: -- → P2
Target Milestone: mozilla1.9.1a1 → mozilla1.9.2a1
Attachment #328322 - Flags: approval1.9.1?
Comment on attachment 328322 [details] [diff] [review] v2 This fixes some window leaks that are not shutdown leaks, just windows staying alive too long. Should be fairly safe, especially because it doesn't add unlink code (which is the part of cycle collection that causes the most crashes). Our current test infrastructure only allows us to test for shutdown leaks, so I can't write a test for this. Hopefully that'll change soon with the fix for bug 469779.
Attachment #328322 - Flags: approval1.9.1? → approval1.9.1+
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: fixed1.9.1
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

Created:
Updated:
Size: