зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
e619daaa68
Коммит
7de684a245
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче