Closed Bug 33160 Opened 26 years ago Closed 26 years ago

MLK: nsSplitterFrameInner leaks some data.

Categories

(Core :: XUL, defect, P2)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: bruce, Assigned: eric)

References

()

Details

(Keywords: memory-leak, Whiteboard: have fix awaiting checking)

Attachments

(2 files)

From beard's leak logs. Appear to leak mChildInfosAfter and mChildInfosBefore. malloc operator new(unsigned long, const std::nothrow_t&) operator new(unsigned long) __nwa(unsigned long) nsSplitterFrameInner::MouseDown(nsIDOMEvent*) nsEventListenerManager::HandleEvent(nsIPresContext*, nsEvent*, nsIDOMEvent**, unsigned int, nsEventStatus*) nsXULElement::HandleDOMEvent(nsIPresContext*, nsEvent*, nsIDOMEvent**, unsigned int, nsEventStatus*) nsXULElement::HandleDOMEvent(nsIPresContext*, nsEvent*, nsIDOMEvent**, unsigned int, nsEventStatus*) PresShell::HandleEvent(nsIView*, nsGUIEvent*, nsEventStatus*, int&) nsView::HandleEvent(nsGUIEvent*, unsigned int, nsEventStatus*, int&) nsView::HandleEvent(nsGUIEvent*, unsigned int, nsEventStatus*, int&) nsViewManager2::DispatchEvent(nsGUIEvent*, nsEventStatus*) HandleEvent(nsGUIEvent*) nsWindow::DispatchEvent(nsGUIEvent*, nsEventStatus&) nsWindow::DispatchWindowEvent(nsGUIEvent&) nsWindow::DispatchMouseEvent(nsMouseEvent&) nsMacEventHandler::HandleMouseDownEvent(EventRecord&) nsMacEventHandler::HandleOSEvent(EventRecord&) nsMacWindow::HandleOSEvent(EventRecord&) nsMacMessageSink::DispatchOSEvent(EventRecord&, GrafPort*) nsMacMessagePump::DispatchOSEventToRaptor(EventRecord&, GrafPort*) nsMacMessagePump::DoMouseDown(EventRecord&) nsMacMessagePump::DispatchEvent(int, EventRecord*) nsMacMessagePump::DoMessagePump() nsAppShell::Run() nsAppShellService::Run() main1(int, char**, nsISplashScreen*) main __NSInitialize(1F1D7564)
I _think_ this might just be because we're not deleting with the right operator. Patch attached, I'm interested in commentary from bruce and beard.
I don't know anything about the mechanics behind beard's leak tools to tell whether or not that is the problem. If anyone has a good idea on how to reproduce this, preferably inside of viewer, I'd be happy to test.
While delete[] is always the right thing to do with arrays of objects, but the real cause of this leak is that ~nsSplitterFrameInner() doesn't do the final delete[], and your patch just fixes the case when mChildInfosBefore/After are reallocated, if I understand the code correctly. So, we need some extra code inserted into ~nsSplitterFrameInner() to do the final delete[].
Thanks guys, you rock! reassigning to evaughan for review/checkin.
Assignee: trudelle → evaughan
Priority: P3 → P2
Target Milestone: --- → M15
To fix all of the FMM errors (delete vs delete[]), you'll also need to look at the other uses of ChildInfos in the file, like, nsSplitterFrameInner::Reverse(). Looking at the file, that was the only other use that I saw.
I have this change made in my current build. I'll land it soon with my box carpool.
Status: NEW → ASSIGNED
Do you have an estimate of when that will happen so that I know when to watch for it? Thanks!
fixed
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
The destructor fix wasn't in. I just added it.
the problem with nsSplitterFrameInner::Reverse() wasn't fixed in the patch and still remains in the tree. Reopening.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: have fix awaiting checking
Mass-moving most M15 bugs to M16
Target Milestone: M15 → M16
fixed. Reverse now cleans itself up.
Status: REOPENED → RESOLVED
Closed: 26 years ago26 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: