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)

x86
Linux
defect

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?
a=hyatt
r=saari
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
Fix checked in 2000-11-07 19:00 PDT.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
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
QA contact updated
QA Contact: gerardok → madhur
verified on build 2000-08-07 and on build 2001-07-09
Status: RESOLVED → VERIFIED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.