Fix leak by giving base class a virtual destructor (and counting the constructor). r=jfrancis@netscape.com

This commit is contained in:
dbaron%fas.harvard.edu 2000-03-23 01:13:38 +00:00
parent 5cfaaa1ec6
commit dc59bf9530
2 changed files with 8 additions and 0 deletions

View File

@ -40,6 +40,8 @@ class nsRulesInfo
int action;
};
MOZ_DECL_CTOR_COUNTER(nsEditRules);
/***************************************************************************
* Interface of editing rules.
*
@ -47,6 +49,8 @@ class nsRulesInfo
class nsEditRules
{
public:
nsEditRules() { MOZ_COUNT_CTOR(nsEditRules); }
virtual ~nsEditRules() { MOZ_COUNT_DTOR(nsEditRules); }
NS_IMETHOD Init(nsHTMLEditor *aEditor, PRUint32 aFlags)=0;
NS_IMETHOD BeforeEdit(PRInt32 action, nsIEditor::EDirection aDirection)=0;
NS_IMETHOD AfterEdit(PRInt32 action, nsIEditor::EDirection aDirection, PRBool aSetSelection)=0;

View File

@ -40,6 +40,8 @@ class nsRulesInfo
int action;
};
MOZ_DECL_CTOR_COUNTER(nsEditRules);
/***************************************************************************
* Interface of editing rules.
*
@ -47,6 +49,8 @@ class nsRulesInfo
class nsEditRules
{
public:
nsEditRules() { MOZ_COUNT_CTOR(nsEditRules); }
virtual ~nsEditRules() { MOZ_COUNT_DTOR(nsEditRules); }
NS_IMETHOD Init(nsHTMLEditor *aEditor, PRUint32 aFlags)=0;
NS_IMETHOD BeforeEdit(PRInt32 action, nsIEditor::EDirection aDirection)=0;
NS_IMETHOD AfterEdit(PRInt32 action, nsIEditor::EDirection aDirection, PRBool aSetSelection)=0;