mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 429233 - Firefox leaks nsTArray_base due to nsDOMKeyboardEvent's dtor not being virtual; also makes ~nsEvent virtual as well and uses MOZ_COUNT_[CD]TOR in nsEvent. Patch by Ben Turner <bent.mozilla@gmail.com>, r+sr=jst, a=beltzner
This commit is contained in:
parent
4b69a276d4
commit
b043c32699
@ -57,6 +57,14 @@ nsDOMKeyboardEvent::nsDOMKeyboardEvent(nsPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
nsDOMKeyboardEvent::~nsDOMKeyboardEvent()
|
||||
{
|
||||
if (mEventIsInternal) {
|
||||
delete static_cast<nsKeyEvent*>(mEvent);
|
||||
mEvent = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsDOMKeyboardEvent, nsDOMUIEvent)
|
||||
NS_IMPL_RELEASE_INHERITED(nsDOMKeyboardEvent, nsDOMUIEvent)
|
||||
|
||||
|
@ -47,6 +47,7 @@ class nsDOMKeyboardEvent : public nsIDOMKeyEvent,
|
||||
{
|
||||
public:
|
||||
nsDOMKeyboardEvent(nsPresContext* aPresContext, nsKeyEvent* aEvent);
|
||||
virtual ~nsDOMKeyboardEvent();
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include "nsWeakPtr.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
|
||||
class nsIRenderingContext;
|
||||
class nsIRegion;
|
||||
@ -394,6 +395,7 @@ protected:
|
||||
flags(isTrusted ? NS_EVENT_FLAG_TRUSTED : NS_EVENT_FLAG_NONE),
|
||||
userType(0)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsEvent);
|
||||
}
|
||||
|
||||
public:
|
||||
@ -405,6 +407,12 @@ public:
|
||||
flags(isTrusted ? NS_EVENT_FLAG_TRUSTED : NS_EVENT_FLAG_NONE),
|
||||
userType(0)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsEvent);
|
||||
}
|
||||
|
||||
~nsEvent()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsEvent);
|
||||
}
|
||||
|
||||
// See event struct types
|
||||
|
Loading…
Reference in New Issue
Block a user