Closed
Bug 377899
Opened 17 years ago
Closed 17 years ago
Cycle between nsXULTooltipListener and nsGlobalWindows causes leaks
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
People
(Reporter: peterv, Assigned: smaug)
References
Details
(Keywords: memory-leak)
Attachments
(3 files)
517 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
73.75 KB,
image/png
|
Details | |
6.31 KB,
patch
|
neil
:
review+
peterv
:
superreview+
|
Details | Diff | Splinter Review |
See bug 376802, comment 11 and others. In the attached testcase, hover over the button and the browser will quit, leaking nsGlobalWindows (the first time you'll need to allow UniversalXPConnect privileges). It shows one way to keep a nsGlobalWindow alive, I'll also attach part of an ownership graph.
Reporter | ||
Comment 1•17 years ago
|
||
The missing edge to nsXULTooltipListener comes from nsLayoutStatics (which keeps it because there are live nsGlobalWindows).
Comment 2•17 years ago
|
||
The tooltiplistener keeps a strong reference to the tooltip as long as the tooltip is shown, so waiting for a popuphiding event that never comes. I assume before bug 376802 the tooltip listener would have been destroyed when the source element was unbound from the tree, thus releasing the reference to the tooltip?
Assignee | ||
Comment 3•17 years ago
|
||
Assignee | ||
Updated•17 years ago
|
Attachment #262751 -
Flags: superreview?(peterv)
Reporter | ||
Comment 4•17 years ago
|
||
Comment on attachment 262751 [details] [diff] [review] using cycle collector, v1 That should work, yes.
Attachment #262751 -
Flags: superreview?(peterv) → superreview+
Comment 5•17 years ago
|
||
Comment on attachment 262751 [details] [diff] [review] using cycle collector, v1 >- >- // nsISupports >- NS_DECL_ISUPPORTS >+ NS_DECL_CYCLE_COLLECTING_ISUPPORTS >+ NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULTooltipListener, >+ nsIDOMMouseListener) > > // nsIDOMMouseListener Nit: any reason why you removed the nsISupports comment?
Attachment #262751 -
Flags: review?(neil) → review+
Assignee | ||
Comment 6•17 years ago
|
||
Because NS_DECL_CYCLE_COLLECTING_*** does something else too, not only declares nsISupports.
Assignee | ||
Updated•17 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Flags: in-testsuite-
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•