From 8041a5097310f580eeaa7bb2672ac18e28a492c3 Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Sat, 15 Jan 2005 01:09:16 +0000 Subject: [PATCH] Make sure stub-derived elements get destroyed properly by adding a virtual destructor. r=dbaron. --- extensions/xforms/nsXFormsStubElement.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/extensions/xforms/nsXFormsStubElement.h b/extensions/xforms/nsXFormsStubElement.h index e04c6d366f75..a9b6d2ac3362 100644 --- a/extensions/xforms/nsXFormsStubElement.h +++ b/extensions/xforms/nsXFormsStubElement.h @@ -51,6 +51,13 @@ */ class nsXFormsStubElement : public nsIXTFGenericElement { +protected: + // We need a virtual destructor so that when a subclass does + // NS_IMPL_ISUPPORTS_INHERITED, our Release() implementation calls the + // derived class destructor. + virtual ~nsXFormsStubElement() {} + +public: NS_DECL_ISUPPORTS NS_DECL_NSIXTFELEMENT NS_DECL_NSIXTFGENERICELEMENT @@ -66,6 +73,13 @@ class nsXFormsStubElement : public nsIXTFGenericElement */ class nsXFormsXMLVisualStub : public nsIXTFXMLVisual { +protected: + // We need a virtual destructor so that when a subclass does + // NS_IMPL_ISUPPORTS_INHERITED, our Release() implementation calls the + // derived class destructor. + virtual ~nsXFormsXMLVisualStub() {} + +public: NS_DECL_ISUPPORTS NS_DECL_NSIXTFELEMENT NS_DECL_NSIXTFVISUAL