Open Bug 1348895 Opened 7 years ago Updated 2 years ago

nsTypeAheadFind shouldn't create a dom-window-destroyed observer for every docshell

Categories

(Toolkit :: Find Toolbar, defect)

defect

Tracking

()

People

(Reporter: Gijs, Unassigned)

References

(Blocks 1 open bug)

Details

Right now nsTypeAheadFind.cpp registers an observer for dom-window-destroyed for every docshell in which it's created (which is pretty much every content one):

https://dxr.mozilla.org/mozilla-central/rev/1b9293be51637f841275541d8991314ca56561a5/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp#121

In the observe() method, it then checks if the subject is its own docshell, and then nulls out some references:

https://dxr.mozilla.org/mozilla-central/rev/1b9293be51637f841275541d8991314ca56561a5/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp#265-268

It seems to me that these instances should be owned by the docshell, and nstypeaheadfind shouldn't have any strong refs to the docshell at all - but then, I'm not familiar with this code so maybe there's a good reason that doesn't work?
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.