Closed
Bug 393294
Opened 17 years ago
Closed 17 years ago
nsDOMPopupBlockedEvent leaks an nsWeakReference
Categories
(Core :: DOM: Events, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: sayrer, Unassigned)
References
()
Details
(Keywords: memory-leak)
Attachments
(3 files)
3.35 KB,
text/plain
|
Details | |
557 bytes,
patch
|
smaug
:
review+
sicking
:
superreview+
jst
:
approval1.9+
|
Details | Diff | Splinter Review |
2.97 KB,
patch
|
jst
:
review+
jst
:
superreview+
jst
:
approval1.9+
|
Details | Diff | Splinter Review |
Pretty much any site that tries to open a popup seems to trigger this leak.
Comment 1•17 years ago
|
||
This is untested, but should fix this leak.
Attachment #277808 -
Flags: superreview?(dbaron)
Attachment #277808 -
Flags: review?(sayrer)
Comment 2•17 years ago
|
||
And the attached patch should also make us not leak the nsString members in nsPopupBlockedEvent too.
Comment 3•17 years ago
|
||
While I'm for some reason unable to get gdb to break when we hit this code, I do know for a fact that this code does run (yay for good ol' printf()). Given that, this should fix this leak.
Updated•17 years ago
|
Attachment #277808 -
Flags: review?(sayrer) → review?(Olli.Pettay)
Updated•17 years ago
|
Attachment #277808 -
Flags: review?(Olli.Pettay) → review+
Comment 4•17 years ago
|
||
nsBeforePageUnloadEvent has an nsString member and nsCommandEvent has an nsCOMPtr<nsIAtom> member.
Attachment #277881 -
Flags: superreview?(jst)
Attachment #277881 -
Flags: review?(jst)
Comment 5•17 years ago
|
||
Comment on attachment 277881 [details] [diff] [review] fix 2 other possible leaks class nsDOMCommandEvent : public nsDOMEvent, public nsIDOMCommandEvent { public: nsDOMCommandEvent(nsPresContext* aPresContext, nsCommandEvent* aEvent); + ~nsDOMCommandEvent(); Might as well explicitly state here that this is virtual while you're at it. r+sr+a=jst
Attachment #277881 -
Flags: superreview?(jst)
Attachment #277881 -
Flags: superreview+
Attachment #277881 -
Flags: review?(jst)
Attachment #277881 -
Flags: review+
Attachment #277881 -
Flags: approval1.9+
Comment 6•17 years ago
|
||
Checked in the patch 2 (added |virtual|)
Comment 7•17 years ago
|
||
nsDOMBeforeUnloadEvent::~nsDOMBeforeUnloadEvent() { + if (mEventIsInternal && + mEvent->eventStructType == NS_BEFORE_PAGE_UNLOAD_EVENT) { + delete static_cast<nsBeforePageUnloadEvent*>(mEvent); + mEvent = nsnull; + } } Nit: incorrectly indented body
Attachment #277808 -
Flags: superreview?(dbaron) → superreview+
Updated•17 years ago
|
Attachment #277808 -
Flags: approval1.9+
Comment 8•17 years ago
|
||
Fix checked in. (and fixed the indentation issue pointed out by jag as well.)
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 9•17 years ago
|
||
Heh, you unindented the wrapped part of the |if| condition. I re-indented that for you.
Comment 10•17 years ago
|
||
Duh. Thanks Jag!
You need to log in
before you can comment on or make changes to this bug.
Description
•