Closed
Bug 59042
Opened 25 years ago
Closed 25 years ago
leak clicking in and typing in URL bar
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
VERIFIED
FIXED
mozilla0.9
People
(Reporter: dbaron, Assigned: dbaron)
Details
(Keywords: memory-leak)
DESCRIPTION: I see a leak of an nsHTMLInputElement and a bunch of stuff it owns
if I start mozilla, double click in the URL bar, type a URL, and hit enter. The
patch below fixes the leak:
Index: nsEventStateManager.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/events/src/nsEventStateManager.cpp,v
retrieving revision 1.221
diff -u -d -r1.221 nsEventStateManager.cpp
--- nsEventStateManager.cpp 2000/11/02 05:15:23 1.221
+++ nsEventStateManager.cpp 2000/11/03 21:50:56
@@ -361,7 +361,7 @@
mDocument->GetScriptGlobalObject(getter_AddRefs(globalObject));
if (globalObject) {
nsIContent* currentFocus = mCurrentFocus;
- mCurrentFocus = nsnull;
+ mCurrentFocus = nsnull; // keep the owning reference in currentFocus
if(gLastFocusedDocument != mDocument) {
mDocument->HandleDOMEvent(aPresContext, &focusevent, nsnull,
NS_EVENT_FLAG_INIT, &status);
if (currentFocus && currentFocus != gLastFocusedContent)
@@ -369,7 +369,8 @@
}
globalObject->HandleDOMEvent(aPresContext, &focusevent, nsnull,
NS_EVENT_FLAG_INIT, &status);
- mCurrentFocus = currentFocus;
+ NS_IF_RELEASE(mCurrentFocus);
+ mCurrentFocus = currentFocus; // we kept this reference above
NS_IF_RELEASE(gLastFocusedContent);
gLastFocusedContent = mCurrentFocus;
NS_IF_ADDREF(gLastFocusedContent)
Hyatt added this potential leak in revision 1.94, although later revisions may
have caused it to actually cause a leak. Hyatt or Saari -- could you review?
Comment 1•25 years ago
|
||
a=hyatt
Comment 2•25 years ago
|
||
r=saari
| Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
| Assignee | ||
Comment 3•25 years ago
|
||
Fix checked in 2000-11-07 19:00 PDT.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 4•24 years ago
|
||
Reassigning QA Contact for all open and unverified bugs previously under Lorca's
care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok
Comment 6•24 years ago
|
||
verified on build 2000-08-07 and on build 2001-07-09
Status: RESOLVED → VERIFIED
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•