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
git-svn-id: svn://10.0.0.236/trunk@250407 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
1b4894ea06
commit
269a4e0975
@ -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…
x
Reference in New Issue
Block a user