Bug 1033619 - Fix more dangerous public destructor issues, r=Neil. a=bustage fix on CLOSED TREE.
authorJoshua Cranmer <Pidgeot18@gmail.com>
Thu, 10 Jul 2014 00:19:01 -0500
changeset 20463 43010e7a79b9b249a1b3cc12cce1acd555a83fa0
parent 20462 c9e1ebd968547d16b9fc48736a65621997b95e7c
child 20464 5b91fb2b9568470c9cdbbbbd0902fcad817906f1
push id1209
push usermbanner@mozilla.com
push dateTue, 02 Sep 2014 16:59:36 +0000
treeherdercomm-beta@842e0fd167ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil, bustage
bugs1033619
Bug 1033619 - Fix more dangerous public destructor issues, r=Neil. a=bustage fix on CLOSED TREE.
db/mork/src/morkCellObject.h
db/mork/src/morkCursor.h
db/mork/src/morkEnv.h
db/mork/src/morkFactory.h
db/mork/src/morkFile.h
db/mork/src/morkPortTableCursor.h
db/mork/src/morkRowCellCursor.h
db/mork/src/morkRowObject.h
db/mork/src/morkStore.h
db/mork/src/morkTable.h
db/mork/src/morkTableRowCursor.h
db/mork/src/morkThumb.h
mailnews/addrbook/src/nsAbBSDirectory.h
mailnews/addrbook/src/nsAbLDAPDirectory.h
mailnews/addrbook/src/nsAbMDBCard.h
mailnews/addrbook/src/nsAbMDBDirProperty.h
mailnews/addrbook/src/nsAbMDBDirectory.h
mailnews/addrbook/src/nsAbOSXDirectory.h
mailnews/base/search/src/nsMsgLocalSearch.h
mailnews/base/src/nsMsgAccountManagerDS.h
mailnews/base/src/nsMsgFolderDataSource.h
mailnews/base/src/nsMsgQuickSearchDBView.h
mailnews/base/src/nsMsgSearchDBView.h
mailnews/base/util/nsMsgDBFolder.h
mailnews/compose/src/nsSmtpProtocol.h
mailnews/db/msgdb/public/nsNewsDatabase.h
mailnews/imap/src/nsImapIncomingServer.h
mailnews/imap/src/nsImapProtocol.h
mailnews/imap/src/nsImapUndoTxn.h
mailnews/imap/src/nsImapUrl.h
mailnews/local/src/nsLocalMailFolder.h
mailnews/local/src/nsLocalUndoTxn.h
mailnews/local/src/nsMailboxUrl.h
mailnews/local/src/nsMovemailIncomingServer.h
mailnews/local/src/nsNoIncomingServer.h
mailnews/local/src/nsParseMailbox.h
mailnews/local/src/nsPop3IncomingServer.h
mailnews/local/src/nsPop3Protocol.h
mailnews/local/src/nsRssIncomingServer.h
mailnews/news/src/nsNNTPProtocol.h
mailnews/news/src/nsNewsFolder.h
mailnews/news/src/nsNntpIncomingServer.h
mailnews/news/src/nsNntpUrl.h
--- a/db/mork/src/morkCellObject.h
+++ b/db/mork/src/morkCellObject.h
@@ -46,17 +46,16 @@ public: // state is public because the e
   morkCell*       mCellObject_Cell;       // cell in row if rowseed matches
   mork_column     mCellObject_Col;        // col of cell last living in pos
   mork_u2         mCellObject_RowSeed;    // copy of row's seed
   mork_u2         mCellObject_Pos;        // position of cell in row
   
 // { ===== begin morkNode interface =====
 public: // morkNode virtual methods
   virtual void CloseMorkNode(morkEnv* ev); // CloseCellObject() only if open
-  virtual ~morkCellObject(); // assert that CloseCellObject() executed earlier
   
 public: // morkCellObject construction & destruction
   morkCellObject(morkEnv* ev, const morkUsage& inUsage,
     nsIMdbHeap* ioHeap, morkRow* ioRow, morkCell* ioCell,
     mork_column inCol, mork_pos inPos);
   void CloseCellObject(morkEnv* ev); // called by CloseMorkNode();
 
   NS_IMETHOD SetBlob(nsIMdbEnv* ev,
@@ -128,16 +127,17 @@ public: // morkCellObject construction &
 
   NS_IMETHOD GetChildTable( // access table of specific attribute
     nsIMdbEnv* ev, // context
     nsIMdbTable** acqTable); // acquire child table (or nil if no child)
   // } ----- end children methods -----
 
 // } ===== end nsIMdbCell methods =====
 private: // copying is not allowed
+  virtual ~morkCellObject(); // assert that CloseCellObject() executed earlier
   morkCellObject(const morkCellObject& other);
   morkCellObject& operator=(const morkCellObject& other);
 
 public: // dynamic type identification
   mork_bool IsCellObject() const
   { return IsNode() && mNode_Derived == morkDerived_kCellObject; }
 // } ===== end morkNode methods =====
 
--- a/db/mork/src/morkCursor.h
+++ b/db/mork/src/morkCursor.h
@@ -80,22 +80,24 @@ public: // state is public because the e
   mork_seed  mCursor_Seed;
   mork_pos   mCursor_Pos;
   mork_bool  mCursor_DoFailOnSeedOutOfSync;
   mork_u1    mCursor_Pad[ 3 ]; // explicitly pad to u4 alignment
   
 // { ===== begin morkNode interface =====
 public: // morkNode virtual methods
   virtual void CloseMorkNode(morkEnv* ev); // CloseCursor() only if open
-  virtual ~morkCursor(); // assert that CloseCursor() executed earlier
   
 public: // morkCursor construction & destruction
   morkCursor(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap);
   void CloseCursor(morkEnv* ev); // called by CloseMorkNode();
 
+protected:
+  virtual ~morkCursor(); // assert that CloseCursor() executed earlier
+
 private: // copying is not allowed
   morkCursor(const morkCursor& other);
   morkCursor& operator=(const morkCursor& other);
 
 public: // dynamic type identification
   mork_bool IsCursor() const
   { return IsNode() && mNode_Derived == morkDerived_kCursor; }
 // } ===== end morkNode methods =====
@@ -107,12 +109,11 @@ public: // typesafe refcounting inlines 
     morkEnv* ev, morkCursor** ioSlot)
   { morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
   
   static void SlotStrongCursor(morkCursor* me,
     morkEnv* ev, morkCursor** ioSlot)
   { morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
 };
 
-
 //3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
 
 #endif /* _MORKCURSOR_ */
--- a/db/mork/src/morkEnv.h
+++ b/db/mork/src/morkEnv.h
@@ -196,11 +196,17 @@ public: // typesafe refcounting inlines 
     morkEnv* ev, morkEnv** ioSlot)
   { morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }
   
   static void SlotStrongEnv(morkEnv* me,
     morkEnv* ev, morkEnv** ioSlot)
   { morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }
 };
 
+namespace mozilla {
+template <> struct HasDangerousPublicDestructor<morkEnv> {
+  static const bool value = true;
+};
+} // namespace mozilla
+
 //3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
 
 #endif /* _MORKENV_ */
--- a/db/mork/src/morkFactory.h
+++ b/db/mork/src/morkFactory.h
@@ -51,17 +51,16 @@ public: // state is public because the e
 
   morkEnv        mFactory_Env; // private env instance used internally
   orkinHeap      mFactory_Heap;
 
   NS_DECL_ISUPPORTS_INHERITED
 // { ===== begin morkNode interface =====
 public: // morkFactory virtual methods
   virtual void CloseMorkNode(morkEnv* ev); // CloseFactory() only if open
-  virtual ~morkFactory(); // assert that CloseFactory() executed earlier
 
 
 // { ===== begin nsIMdbFactory methods =====
 
   // { ----- begin file methods -----
   NS_IMETHOD OpenOldFile(nsIMdbEnv* ev, nsIMdbHeap* ioHeap,
     const char* inFilePath,
     mdb_bool inFrozen, nsIMdbFile** acqFile);
@@ -171,16 +170,17 @@ public: // morkNode memory management op
   { return ::operator new(inSize); }
   
   void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) CPP_THROW_NEW
   { return morkNode::MakeNew(inSize, ioHeap, ev); }
   
 private: // copying is not allowed
   morkFactory(const morkFactory& other);
   morkFactory& operator=(const morkFactory& other);
+  virtual ~morkFactory(); // assert that CloseFactory() executed earlier
 
 public: // dynamic type identification
   mork_bool IsFactory() const
   { return IsNode() && mNode_Derived == morkDerived_kFactory; }
 // } ===== end morkNode methods =====
 
 public: // other factory methods
 
--- a/db/mork/src/morkFile.h
+++ b/db/mork/src/morkFile.h
@@ -76,33 +76,33 @@ class morkFile /*d*/ : public morkObject
   
 // public: // slots inherited from morkObject (meant to inform only)
 
   // mork_color   mBead_Color;   // ID for this bead
   // morkHandle*  mObject_Handle;  // weak ref to handle for this object
 
 // ````` ````` ````` `````   ````` ````` ````` `````  
 protected: // protected morkFile members (similar to public domain IronDoc)
+  virtual ~morkFile(); // assert that CloseFile() executed earlier
 
   mork_u1     mFile_Frozen;   // 'F' => file allows only read access
   mork_u1     mFile_DoTrace;  // 'T' trace if ev->DoTrace()
   mork_u1     mFile_IoOpen;   // 'O' => io stream is open (& needs a close)
   mork_u1     mFile_Active;   // 'A' => file is active and usable
   
   nsIMdbHeap* mFile_SlotHeap; // heap for Name and other allocated slots
   char*       mFile_Name; // can be nil if SetFileName() is never called
   // mFile_Name convention: managed with morkEnv::CopyString()/FreeString()
 
   nsIMdbFile* mFile_Thief; // from a call to orkinFile::Steal()
   
 // { ===== begin morkNode interface =====
 public: // morkNode virtual methods
   NS_DECL_ISUPPORTS_INHERITED
   virtual void CloseMorkNode(morkEnv* ev); // CloseFile() only if open
-  virtual ~morkFile(); // assert that CloseFile() executed earlier
   
 public: // morkFile construction & destruction
   morkFile(morkEnv* ev, const morkUsage& inUsage, nsIMdbHeap* ioHeap,
     nsIMdbHeap* ioSlotHeap);
   void CloseFile(morkEnv* ev); // called by CloseMorkNode();
 
 private: // copying is not allowed
   morkFile(const morkFile& other);
--- a/db/mork/src/morkPortTableCursor.h
+++ b/db/mork/src/morkPortTableCursor.h
@@ -83,17 +83,16 @@ public: // state is public because the e
   
   mork_bool           mPortTableCursor_TablesDidEnd; // no more tables?
   mork_bool           mPortTableCursor_SpacesDidEnd; // no more spaces?
   mork_u1             mPortTableCursor_Pad[ 2 ]; // for u4 alignment
    
 // { ===== begin morkNode interface =====
 public: // morkNode virtual methods
   virtual void CloseMorkNode(morkEnv* ev); // ClosePortTableCursor()
-  virtual ~morkPortTableCursor(); // assert that close executed earlier
   
 public: // morkPortTableCursor construction & destruction
   morkPortTableCursor(morkEnv* ev, const morkUsage& inUsage,
     nsIMdbHeap* ioHeap, morkStore* ioStore, mdb_scope inRowScope,
       mdb_kind inTableKind, nsIMdbHeap* ioSlotHeap);
   void ClosePortTableCursor(morkEnv* ev); // called by CloseMorkNode();
 
 private: // copying is not allowed
@@ -101,16 +100,17 @@ private: // copying is not allowed
   morkPortTableCursor& operator=(const morkPortTableCursor& other);
 
 public: // dynamic type identification
   mork_bool IsPortTableCursor() const
   { return IsNode() && mNode_Derived == morkDerived_kPortTableCursor; }
 // } ===== end morkNode methods =====
 
 protected: // utilities
+  virtual ~morkPortTableCursor(); // assert that close executed earlier
 
   void init_space_tables_map(morkEnv* ev);
 
 public: // other cursor methods
 
   static void NilCursorStoreError(morkEnv* ev);
   static void NonPortTableCursorTypeError(morkEnv* ev);
 
--- a/db/mork/src/morkRowCellCursor.h
+++ b/db/mork/src/morkRowCellCursor.h
@@ -43,17 +43,16 @@ public: // state is public because the e
 
   NS_DECL_ISUPPORTS_INHERITED
   morkRowObject*   mRowCellCursor_RowObject;  // strong ref to row
   mork_column      mRowCellCursor_Col;        // col of cell last at mCursor_Pos
   
 // { ===== begin morkNode interface =====
 public: // morkNode virtual methods
   virtual void CloseMorkNode(morkEnv* ev); // CloseRowCellCursor()
-  virtual ~morkRowCellCursor(); // assert that close executed earlier
   
 public: // morkRowCellCursor construction & destruction
   morkRowCellCursor(morkEnv* ev, const morkUsage& inUsage,
     nsIMdbHeap* ioHeap, morkRowObject* ioRowObject);
   void CloseRowCellCursor(morkEnv* ev); // called by CloseMorkNode();
 
   // { ----- begin attribute methods -----
   NS_IMETHOD SetRow(nsIMdbEnv* ev, nsIMdbRow* ioRow); // sets pos to -1
@@ -94,16 +93,17 @@ public: // morkRowCellCursor constructio
   // cols, since this might imply a potential excessive consumption of time
   // over many cursor calls when looking for column and filter intersection.
   // } ----- end cell iteration methods -----
 
 
 private: // copying is not allowed
   morkRowCellCursor(const morkRowCellCursor& other);
   morkRowCellCursor& operator=(const morkRowCellCursor& other);
+  virtual ~morkRowCellCursor(); // assert that close executed earlier
 
 public: // dynamic type identification
   mork_bool IsRowCellCursor() const
   { return IsNode() && mNode_Derived == morkDerived_kRowCellCursor; }
 // } ===== end morkNode methods =====
 
 public: // errors
   static void NilRowObjectError(morkEnv* ev);
--- a/db/mork/src/morkRowObject.h
+++ b/db/mork/src/morkRowObject.h
@@ -25,17 +25,16 @@ public: // state is public because the e
   NS_DECL_ISUPPORTS_INHERITED
   
   morkRow*    mRowObject_Row;     // non-refcounted alias to morkRow
   morkStore*  mRowObject_Store;   // non-refcounted ptr to store containing row
   
 // { ===== begin morkNode interface =====
 public: // morkNode virtual methods
   virtual void CloseMorkNode(morkEnv* ev); // CloseRowObject() only if open
-  virtual ~morkRowObject(); // assert that CloseRowObject() executed earlier
   
 public: // morkRowObject construction & destruction
   morkRowObject(morkEnv* ev, const morkUsage& inUsage,
     nsIMdbHeap* ioHeap, morkRow* ioRow, morkStore* ioStore);
   void CloseRowObject(morkEnv* ev); // called by CloseMorkNode();
 
 // { ===== begin nsIMdbCollection methods =====
 
@@ -164,16 +163,17 @@ public: // morkRowObject construction & 
 
   // } ----- end blob methods -----
 
 // } ===== end nsIMdbRow methods =====
 
 private: // copying is not allowed
   morkRowObject(const morkRowObject& other);
   morkRowObject& operator=(const morkRowObject& other);
+  virtual ~morkRowObject(); // assert that CloseRowObject() executed earlier
 
 public: // dynamic type identification
   mork_bool IsRowObject() const
   { return IsNode() && mNode_Derived == morkDerived_kRowObject; }
 // } ===== end morkNode methods =====
 
 public: // typing
   static void NonRowObjectTypeError(morkEnv* ev);
--- a/db/mork/src/morkStore.h
+++ b/db/mork/src/morkStore.h
@@ -606,29 +606,29 @@ public: // lazy creation of members and 
   morkStream*      LazyGetOutStream(morkEnv* ev);
   
   morkRowSpace*    LazyGetRowSpace(morkEnv* ev, mdb_scope inRowScope);
   morkAtomSpace*   LazyGetAtomSpace(morkEnv* ev, mdb_scope inAtomScope);
  
 // { ===== begin morkNode interface =====
 public: // morkNode virtual methods
   virtual void CloseMorkNode(morkEnv* ev); // CloseStore() only if open
-  virtual ~morkStore(); // assert that CloseStore() executed earlier
   
 public: // morkStore construction & destruction
   morkStore(morkEnv* ev, const morkUsage& inUsage,
      nsIMdbHeap* ioNodeHeap, // the heap (if any) for this node instance
      morkFactory* inFactory, // the factory for this
      nsIMdbHeap* ioPortHeap  // the heap to hold all content in the port
      );
   void CloseStore(morkEnv* ev); // called by CloseMorkNode();
 
 private: // copying is not allowed
   morkStore(const morkStore& other);
   morkStore& operator=(const morkStore& other);
+  virtual ~morkStore(); // assert that CloseStore() executed earlier
 
 public: // dynamic type identification
   morkEnv* CanUseStore(nsIMdbEnv* mev, mork_bool inMutable,
                        nsresult* outErr) const;
    mork_bool IsStore() const
   { return IsNode() && mNode_Derived == morkDerived_kStore; }
 // } ===== end morkNode methods =====
 
--- a/db/mork/src/morkTable.h
+++ b/db/mork/src/morkTable.h
@@ -459,30 +459,30 @@ public: // table dirty handling more com
 public: // morkNode memory management operators
   void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) CPP_THROW_NEW
   { return morkNode::MakeNew(inSize, ioHeap, ev); }
   
  
 // { ===== begin morkNode interface =====
 public: // morkNode virtual methods
   virtual void CloseMorkNode(morkEnv* ev); // CloseTable() if open
-  virtual ~morkTable(); // assert that close executed earlier
   
 public: // morkTable construction & destruction
   morkTable(morkEnv* ev, const morkUsage& inUsage,
     nsIMdbHeap* ioNodeHeap, morkStore* ioStore,
     nsIMdbHeap* ioSlotHeap, morkRowSpace* ioRowSpace,
     const mdbOid* inOptionalMetaRowOid, // can be nil to avoid specifying 
     mork_tid inTableId,
     mork_kind inKind, mork_bool inMustBeUnique);
   void CloseTable(morkEnv* ev); // called by CloseMorkNode();
 
 private: // copying is not allowed
   morkTable(const morkTable& other);
   morkTable& operator=(const morkTable& other);
+  virtual ~morkTable(); // assert that close executed earlier
 
 public: // dynamic type identification
   mork_bool IsTable() const
   { return IsNode() && mNode_Derived == morkDerived_kTable; }
 // } ===== end morkNode methods =====
 
 public: // errors
   static void NonTableTypeError(morkEnv* ev);
--- a/db/mork/src/morkTableRowCursor.h
+++ b/db/mork/src/morkTableRowCursor.h
@@ -44,16 +44,18 @@ class morkTableRowCursor : public morkCu
   // mork_u1    mCursor_Pad[ 3 ]; // explicitly pad to u4 alignment
 
 public: // state is public because the entire Mork system is private
   morkTable*  mTableRowCursor_Table; // weak ref to table
     
 // { ===== begin morkNode interface =====
 public: // morkNode virtual methods
   virtual void CloseMorkNode(morkEnv* ev); // CloseTableRowCursor()
+
+protected:
   virtual ~morkTableRowCursor(); // assert that close executed earlier
   
 public: // morkTableRowCursor construction & destruction
   morkTableRowCursor(morkEnv* ev, const morkUsage& inUsage,
     nsIMdbHeap* ioHeap, morkTable* ioTable, mork_pos inRowPos);
   void CloseTableRowCursor(morkEnv* ev); // called by CloseMorkNode();
 
 private: // copying is not allowed
--- a/db/mork/src/morkThumb.h
+++ b/db/mork/src/morkThumb.h
@@ -88,26 +88,26 @@ public: // state is public because the e
   morkPort*    mThumb_SourcePort;  // strong ref to port for import
   
   mork_bool    mThumb_DoCollect; // influence whether a collect happens
   mork_bool    mThumb_Pad[ 3 ]; // padding for u4 alignment
   
 // { ===== begin morkNode interface =====
 public: // morkNode virtual methods
   virtual void CloseMorkNode(morkEnv* ev); // CloseThumb() only if open
-  virtual ~morkThumb(); // assert that CloseThumb() executed earlier
   
 public: // morkThumb construction & destruction
   morkThumb(morkEnv* ev, const morkUsage& inUsage,
     nsIMdbHeap* ioHeap, nsIMdbHeap* ioSlotHeap, mork_magic inMagic);
   void CloseThumb(morkEnv* ev); // called by CloseMorkNode();
 
 private: // copying is not allowed
   morkThumb(const morkThumb& other);
   morkThumb& operator=(const morkThumb& other);
+  virtual ~morkThumb(); // assert that CloseThumb() executed earlier
 
 public: // dynamic type identification
   mork_bool IsThumb() const
   { return IsNode() && mNode_Derived == morkDerived_kThumb; }
 // } ===== end morkNode methods =====
 
 public: // typing
   static void NonThumbTypeError(morkEnv* ev);
--- a/mailnews/addrbook/src/nsAbBSDirectory.h
+++ b/mailnews/addrbook/src/nsAbBSDirectory.h
@@ -14,17 +14,16 @@
 #include "nsCOMArray.h"
 
 class nsAbBSDirectory : public nsAbDirProperty
 {
 public:
 	NS_DECL_ISUPPORTS_INHERITED
 
 	nsAbBSDirectory();
-	virtual ~nsAbBSDirectory();
 
 	// nsIAbDirectory methods
   NS_IMETHOD Init(const char *aURI) MOZ_OVERRIDE;
   NS_IMETHOD GetChildNodes(nsISimpleEnumerator* *result) MOZ_OVERRIDE;
   NS_IMETHOD CreateNewDirectory(const nsAString &aDirName,
                                 const nsACString &aURI,
                                 uint32_t aType,
                                 const nsACString &aPrefName,
@@ -32,16 +31,17 @@ public:
   NS_IMETHOD CreateDirectoryByURI(const nsAString &aDisplayName,
                                   const nsACString &aURI) MOZ_OVERRIDE;
   NS_IMETHOD DeleteDirectory(nsIAbDirectory *directory) MOZ_OVERRIDE;
   NS_IMETHOD HasDirectory(nsIAbDirectory *dir, bool *hasDir) MOZ_OVERRIDE;
   NS_IMETHOD UseForAutocomplete(const nsACString &aIdentityKey, bool *aResult) MOZ_OVERRIDE;
   NS_IMETHOD GetURI(nsACString &aURI) MOZ_OVERRIDE;
 
 protected:
+  virtual ~nsAbBSDirectory();
   nsresult EnsureInitialized();
 	nsresult CreateDirectoriesFromFactory(const nsACString &aURI,
                                         DIR_Server* aServer, bool aNotify);
 
 protected:
 	bool mInitialized;
 	nsCOMArray<nsIAbDirectory> mSubDirectories;
 	nsDataHashtable<nsISupportsHashKey, DIR_Server*> mServers;
--- a/mailnews/addrbook/src/nsAbLDAPDirectory.h
+++ b/mailnews/addrbook/src/nsAbLDAPDirectory.h
@@ -23,17 +23,16 @@ class nsAbLDAPDirectory :
   public nsIAbDirectorySearch,
   public nsIAbLDAPDirectory,
   public nsIAbDirSearchListener
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
 
   nsAbLDAPDirectory();
-  virtual ~nsAbLDAPDirectory();
 
   NS_IMETHOD Init(const char *aUri) MOZ_OVERRIDE;
 
   // nsIAbDirectory methods
   NS_IMETHOD GetPropertiesChromeURI(nsACString &aResult) MOZ_OVERRIDE;
   NS_IMETHOD GetURI(nsACString &aURI) MOZ_OVERRIDE;
   NS_IMETHOD GetChildNodes(nsISimpleEnumerator* *result) MOZ_OVERRIDE;
   NS_IMETHOD GetChildCards(nsISimpleEnumerator* *result) MOZ_OVERRIDE;
@@ -49,16 +48,17 @@ public:
   NS_IMETHOD DeleteCards(nsIArray *aCards) MOZ_OVERRIDE;
 
   // nsIAbDirectorySearch methods
   NS_DECL_NSIABDIRECTORYSEARCH
   NS_DECL_NSIABLDAPDIRECTORY
   NS_DECL_NSIABDIRSEARCHLISTENER
 
 protected:
+  virtual ~nsAbLDAPDirectory();
   nsresult Initiate();
 
   nsresult SplitStringList(const nsACString& aString,
                            uint32_t *aCount,
                            char ***aValues);
 
   bool mPerformingQuery;
   int32_t mContext;
--- a/mailnews/addrbook/src/nsAbMDBCard.h
+++ b/mailnews/addrbook/src/nsAbMDBCard.h
@@ -11,14 +11,16 @@
 #include "nsCOMPtr.h"
 
 class nsAbMDBCard: public nsAbCardProperty
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
 
   nsAbMDBCard(void);
-  virtual ~nsAbMDBCard(void);
 
   NS_IMETHOD Equals(nsIAbCard *card, bool *result) MOZ_OVERRIDE;
+
+private:
+  virtual ~nsAbMDBCard();
 };
 
 #endif
--- a/mailnews/addrbook/src/nsAbMDBDirProperty.h
+++ b/mailnews/addrbook/src/nsAbMDBDirProperty.h
@@ -22,19 +22,19 @@
  /* 
   * Address Book Directory
   */ 
 
 class nsAbMDBDirProperty: public nsIAbMDBDirectory, public nsAbDirProperty
 {
 public: 
 	nsAbMDBDirProperty(void);
-	virtual ~nsAbMDBDirProperty(void);
 
 	NS_DECL_ISUPPORTS
 	NS_DECL_NSIABMDBDIRECTORY
 
 protected:
+  virtual ~nsAbMDBDirProperty();
 
 	uint32_t m_dbRowID;
 };
 
 #endif
--- a/mailnews/addrbook/src/nsAbMDBDirectory.h
+++ b/mailnews/addrbook/src/nsAbMDBDirectory.h
@@ -30,17 +30,16 @@
 class nsAbMDBDirectory:
   public nsAbMDBDirProperty,	// nsIAbDirectory, nsIAbMDBDirectory
   public nsIAbDirSearchListener,
   public nsIAddrDBListener, 
   public nsIAbDirectorySearch
 {
 public: 
   nsAbMDBDirectory(void);
-  virtual ~nsAbMDBDirectory(void);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIADDRDBLISTENER
 
   // Override nsAbMDBDirProperty::Init
   NS_IMETHOD Init(const char *aUri) MOZ_OVERRIDE;
 
   // nsIAbMDBDirectory methods
@@ -78,16 +77,17 @@ public:
 
   // nsIAbDirectorySearch methods
   NS_DECL_NSIABDIRECTORYSEARCH
 
   // nsIAbDirSearchListener methods
   NS_DECL_NSIABDIRSEARCHLISTENER
 
 protected:
+  virtual ~nsAbMDBDirectory();
   nsresult NotifyPropertyChanged(nsIAbDirectory *list, const char *property, const char16_t* oldValue, const char16_t* newValue);
   nsresult NotifyItemAdded(nsISupports *item);
   nsresult NotifyItemDeleted(nsISupports *item);
   nsresult NotifyItemChanged(nsISupports *item);
   nsresult RemoveCardFromAddressList(nsIAbCard* card);
 
   nsresult GetAbDatabase();
   nsCOMPtr<nsIAddrDatabase> mDatabase;  
--- a/mailnews/addrbook/src/nsAbOSXDirectory.h
+++ b/mailnews/addrbook/src/nsAbOSXDirectory.h
@@ -46,23 +46,22 @@ public:
   virtual nsresult DeleteUid(const nsACString &aUid) = 0;
   virtual nsresult GetURI(nsACString &aURI) = 0;
   virtual nsresult Init(const char *aUri) = 0;
   virtual nsresult GetCardByUri(const nsACString &aUri, nsIAbOSXCard **aResult) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIAbOSXDirectory, NS_IABOSXDIRECTORY_IID)
 
-class nsAbOSXDirectory : public nsAbDirProperty,
+class nsAbOSXDirectory MOZ_FINAL : public nsAbDirProperty,
 public nsIAbDirSearchListener,
 public nsIAbOSXDirectory
 {
 public:
   nsAbOSXDirectory();
-  ~nsAbOSXDirectory();
   
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIABDIRSEARCHLISTENER
     
   // nsIAbOSXDirectory method
   NS_IMETHOD Init(const char *aUri) MOZ_OVERRIDE;
   
   // nsAbDirProperty methods
@@ -100,16 +99,17 @@ public:
 
   nsresult DeleteUid(const nsACString &aUid) MOZ_OVERRIDE;
 
   nsresult GetCardByUri(const nsACString &aUri, nsIAbOSXCard **aResult) MOZ_OVERRIDE;
 
   nsresult GetRootOSXDirectory(nsIAbOSXDirectory **aResult);
 
 private:
+  ~nsAbOSXDirectory();
   nsresult FallbackSearch(nsIAbBooleanExpression *aExpression,
                           nsISimpleEnumerator **aCards);
 
   // This is a list of nsIAbCards, kept separate from m_AddressList because:
   // - nsIAbDirectory items that are mailing lists, must keep a list of
   //   nsIAbCards in m_AddressList, however
   // - nsIAbDirectory items that are address books, must keep a list of
   //   nsIAbDirectory (i.e. mailing lists) in m_AddressList, AND no nsIAbCards.
--- a/mailnews/base/search/src/nsMsgLocalSearch.h
+++ b/mailnews/base/search/src/nsMsgLocalSearch.h
@@ -20,17 +20,16 @@ class nsIMsgDBHdr;
 class nsIMsgSearchScopeTerm;
 class nsIMsgFolder;
 class nsMsgSearchBoolExpression;
 
 class nsMsgSearchOfflineMail : public nsMsgSearchAdapter, public nsIUrlListener
 {
 public:
   nsMsgSearchOfflineMail (nsIMsgSearchScopeTerm*, nsISupportsArray *);
-  virtual ~nsMsgSearchOfflineMail ();
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIURLLISTENER
 
   NS_IMETHOD ValidateTerms () MOZ_OVERRIDE;
   NS_IMETHOD Search (bool *aDone) MOZ_OVERRIDE;
   NS_IMETHOD Abort () MOZ_OVERRIDE;
@@ -61,16 +60,17 @@ public:
                                const char *defaultCharset,
                                nsIMsgSearchScopeTerm * scope,
                                nsIMsgDatabase * db,
                                const char * headers,
                                uint32_t headerSize,
                                bool Filtering,
                  bool *pResult);
 protected:
+  virtual ~nsMsgSearchOfflineMail();
   static nsresult MatchTerms(nsIMsgDBHdr *msgToMatch,
                                 nsISupportsArray *termList,
                                 const char *defaultCharset,
                                 nsIMsgSearchScopeTerm *scope,
                                 nsIMsgDatabase * db,
                                 const char * headers,
                                 uint32_t headerSize,
                                 bool ForFilters,
--- a/mailnews/base/src/nsMsgAccountManagerDS.h
+++ b/mailnews/base/src/nsMsgAccountManagerDS.h
@@ -29,17 +29,16 @@
 class nsMsgAccountManagerDataSource : public nsMsgRDFDataSource,
                                       public nsIFolderListener,
                                       public nsIIncomingServerListener
 {
 
 public:
     
   nsMsgAccountManagerDataSource();
-  virtual ~nsMsgAccountManagerDataSource();
   virtual nsresult Init() MOZ_OVERRIDE;
 
   virtual void Cleanup() MOZ_OVERRIDE;
   // service manager shutdown method
   
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIFOLDERLISTENER
   NS_DECL_NSIINCOMINGSERVERLISTENER
@@ -58,16 +57,17 @@ public:
 
   NS_IMETHOD HasAssertion(nsIRDFResource *aSource, nsIRDFResource *aProperty,
                           nsIRDFNode *aTarget, bool aTruthValue,
                           bool *_retval) MOZ_OVERRIDE;
   NS_IMETHOD HasArcOut(nsIRDFResource *source, nsIRDFResource *aArc,
                        bool *result) MOZ_OVERRIDE;
     
 protected:
+  virtual ~nsMsgAccountManagerDataSource();
 
   nsresult HasAssertionServer(nsIMsgIncomingServer *aServer,
                               nsIRDFResource *aProperty,
                               nsIRDFNode *aTarget,
                               bool aTruthValue, bool *_retval);
 
   nsresult HasAssertionAccountRoot(nsIRDFResource *aProperty,
                                    nsIRDFNode *aTarget,
--- a/mailnews/base/src/nsMsgFolderDataSource.h
+++ b/mailnews/base/src/nsMsgFolderDataSource.h
@@ -20,17 +20,16 @@ class nsMsgFolderDataSource : public nsM
                               public nsIFolderListener
 {
 public:
   
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIFOLDERLISTENER
 
   nsMsgFolderDataSource(void);
-  virtual ~nsMsgFolderDataSource (void);
   virtual nsresult Init() MOZ_OVERRIDE;
   virtual void Cleanup() MOZ_OVERRIDE;
 
   // nsIRDFDataSource methods
   NS_IMETHOD GetURI(char* *uri) MOZ_OVERRIDE;
 
   NS_IMETHOD GetSource(nsIRDFResource* property,
                        nsIRDFNode* target,
@@ -86,16 +85,17 @@ public:
                               nsIRDFResource*   aCommand,
                               nsISupportsArray/*<nsIRDFResource>*/* aArguments,
                               bool* aResult) MOZ_OVERRIDE;
 
   NS_IMETHOD DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
                        nsIRDFResource*   aCommand,
                        nsISupportsArray/*<nsIRDFResource>*/* aArguments) MOZ_OVERRIDE;
 protected:
+  virtual ~nsMsgFolderDataSource();
 
   nsresult GetSenderName(nsAutoString& sender, nsAutoString *senderUserName);
 
   nsresult createFolderNode(nsIMsgFolder *folder, nsIRDFResource* property,
                             nsIRDFNode **target);
   nsresult createFolderNameNode(nsIMsgFolder *folder, nsIRDFNode **target, bool sort);
   nsresult createFolderOpenNode(nsIMsgFolder *folder,nsIRDFNode **target);
   nsresult createFolderTreeNameNode(nsIMsgFolder *folder, nsIRDFNode **target);
--- a/mailnews/base/src/nsMsgQuickSearchDBView.h
+++ b/mailnews/base/src/nsMsgQuickSearchDBView.h
@@ -13,17 +13,16 @@
 #include "nsCOMArray.h"
 #include "nsIMsgHdr.h"
 
 
 class nsMsgQuickSearchDBView : public nsMsgThreadedDBView, public nsIMsgSearchNotify
 {
 public:
   nsMsgQuickSearchDBView();
-  virtual ~nsMsgQuickSearchDBView();
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIMSGSEARCHNOTIFY
 
   virtual const char * GetViewName(void) MOZ_OVERRIDE {return "QuickSearchView"; }
   NS_IMETHOD Open(nsIMsgFolder *folder, nsMsgViewSortTypeValue sortType, 
                   nsMsgViewSortOrderValue sortOrder, 
                   nsMsgViewFlagsTypeValue viewFlags, int32_t *pCount) MOZ_OVERRIDE;
@@ -49,16 +48,17 @@ public:
                          uint32_t aNewFlags, nsIDBChangeListener *aInstigator) MOZ_OVERRIDE;
   NS_IMETHOD OnHdrPropertyChanged(nsIMsgDBHdr *aHdrToChange, bool aPreChange, uint32_t *aStatus, 
                                  nsIDBChangeListener * aInstigator) MOZ_OVERRIDE;
   NS_IMETHOD OnHdrDeleted(nsIMsgDBHdr *aHdrDeleted, nsMsgKey aParentKey,
                           int32_t aFlags, nsIDBChangeListener *aInstigator) MOZ_OVERRIDE;
   NS_IMETHOD GetNumMsgsInView(int32_t *aNumMsgs);
 
 protected:
+  virtual ~nsMsgQuickSearchDBView();
   nsWeakPtr m_searchSession;
   nsTArray<nsMsgKey> m_origKeys;
   bool      m_usingCachedHits;
   bool      m_cacheEmpty;
   nsCOMArray <nsIMsgDBHdr> m_hdrHits;
   virtual nsresult AddHdr(nsIMsgDBHdr *msgHdr, nsMsgViewIndex *resultIndex = nullptr) MOZ_OVERRIDE;
   virtual nsresult OnNewHeader(nsIMsgDBHdr *newHdr, nsMsgKey aParentKey, bool ensureListed) MOZ_OVERRIDE;
   virtual nsresult DeleteMessages(nsIMsgWindow *window, nsMsgViewIndex *indices, int32_t numIndices, bool deleteStorage) MOZ_OVERRIDE;
--- a/mailnews/base/src/nsMsgSearchDBView.h
+++ b/mailnews/base/src/nsMsgSearchDBView.h
@@ -12,17 +12,16 @@
 #include "nsIMsgSearchNotify.h"
 #include "nsMsgXFViewThread.h"
 #include "nsCOMArray.h"
 
 class nsMsgSearchDBView : public nsMsgGroupView, public nsIMsgCopyServiceListener, public nsIMsgSearchNotify
 {
 public:
   nsMsgSearchDBView();
-  virtual ~nsMsgSearchDBView();
 
   // these are tied together pretty intimately
   friend class nsMsgXFViewThread;
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIMSGSEARCHNOTIFY
   NS_DECL_NSIMSGCOPYSERVICELISTENER
 
@@ -66,16 +65,17 @@ public:
   virtual nsCOMArray<nsIMsgFolder>* GetFolders() MOZ_OVERRIDE;
   virtual nsresult GetFolderFromMsgURI(const char *aMsgURI, nsIMsgFolder **aFolder) MOZ_OVERRIDE;
 
   NS_IMETHOD SetCurCustomColumn(const nsAString& aColID);
   NS_IMETHOD GetCurCustomColumn(nsAString &result);
   NS_IMETHOD GetThreadContainingMsgHdr(nsIMsgDBHdr *msgHdr, nsIMsgThread **pThread) MOZ_OVERRIDE;
 
 protected:
+  virtual ~nsMsgSearchDBView();
   virtual void InternalClose() MOZ_OVERRIDE;
   virtual nsresult HashHdr(nsIMsgDBHdr *msgHdr, nsString& aHashKey) MOZ_OVERRIDE;
   virtual nsresult ListIdsInThread(nsIMsgThread *threadHdr, 
                                    nsMsgViewIndex startOfThreadViewIndex, 
                                    uint32_t *pNumListed) MOZ_OVERRIDE;
   nsresult FetchLocation(int32_t aRow, nsAString& aLocationString);
   virtual nsresult AddHdrFromFolder(nsIMsgDBHdr *msgHdr, nsIMsgFolder *folder);
   virtual nsresult GetDBForViewIndex(nsMsgViewIndex index, nsIMsgDatabase **db) MOZ_OVERRIDE;
--- a/mailnews/base/util/nsMsgDBFolder.h
+++ b/mailnews/base/util/nsMsgDBFolder.h
@@ -48,17 +48,16 @@ class NS_MSG_BASE nsMsgDBFolder: public 
                                  public nsIMsgFolder,
                                  public nsIDBChangeListener,
                                  public nsIUrlListener,
                                  public nsIJunkMailClassificationListener,
                                  public nsIMsgTraitClassificationListener
 {
 public: 
   nsMsgDBFolder(void);
-  virtual ~nsMsgDBFolder(void);
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIMSGFOLDER
   NS_DECL_NSIDBCHANGELISTENER
   NS_DECL_NSIURLLISTENER
   NS_DECL_NSIJUNKMAILCLASSIFICATIONLISTENER
   NS_DECL_NSIMSGTRAITCLASSIFICATIONLISTENER
   
   NS_IMETHOD WriteToFolderCacheElem(nsIMsgFolderCacheElement *element);
@@ -79,16 +78,17 @@ public:
   void ChangeNumPendingTotalMessages(int32_t delta);
 
   nsresult CreateDirectoryForFolder(nsIFile **result);
   nsresult CreateBackupDirectory(nsIFile **result);
   nsresult GetBackupSummaryFile(nsIFile **result, const nsACString& newName);
   nsresult GetMsgPreviewTextFromStream(nsIMsgDBHdr *msgHdr, nsIInputStream *stream);
   nsresult HandleAutoCompactEvent(nsIMsgWindow *aMsgWindow);
 protected:
+  virtual ~nsMsgDBFolder();
   
   // this is a little helper function that is not part of the public interface. 
   // we use it to get the IID of the incoming server for the derived folder.
   // w/out a function like this we would have to implement GetServer in each
   // derived folder class.
   virtual void GetIncomingServerType(nsCString& serverType) = 0;
 
   virtual nsresult CreateBaseMessageURI(const nsACString& aURI);
--- a/mailnews/compose/src/nsSmtpProtocol.h
+++ b/mailnews/compose/src/nsSmtpProtocol.h
@@ -76,29 +76,29 @@ SMTP_SEND_AUTH_GSSAPI_STEP              
 
 class nsSmtpProtocol : public nsMsgAsyncWriteProtocol
 {
 public:
     NS_DECL_ISUPPORTS_INHERITED
 
     // Creating a protocol instance requires the URL which needs to be run.
     nsSmtpProtocol(nsIURI * aURL);
-    virtual ~nsSmtpProtocol();
 
     virtual nsresult LoadUrl(nsIURI * aURL, nsISupports * aConsumer = nullptr) MOZ_OVERRIDE;
     virtual nsresult SendData(const char * dataBuffer, bool aSuppressLogging = false) MOZ_OVERRIDE;
 
     ////////////////////////////////////////////////////////////////////////////////////////
     // we suppport the nsIStreamListener interface 
     ////////////////////////////////////////////////////////////////////////////////////////
 
     // stop binding is a "notification" informing us that the stream associated with aURL is going away. 
     NS_IMETHOD OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult status) MOZ_OVERRIDE;
 
 private:
+    virtual ~nsSmtpProtocol();
     // if we are asked to load a url while we are blocked waiting for redirection information,
     // then we'll store the url consumer in mPendingConsumer until we can actually load
     // the url.
     nsCOMPtr<nsISupports> mPendingConsumer;
 
     // the nsISmtpURL that is currently running
     nsCOMPtr<nsISmtpUrl> m_runningURL;
 
--- a/mailnews/db/msgdb/public/nsNewsDatabase.h
+++ b/mailnews/db/msgdb/public/nsNewsDatabase.h
@@ -14,17 +14,16 @@ class nsIDBChangeListener;
 class MSG_RetrieveArtInfo;
 class MSG_PurgeInfo;
 // news group database
 
 class nsNewsDatabase : public nsMsgDatabase , public nsINewsDatabase
 {
 public:
   nsNewsDatabase();
-  virtual ~nsNewsDatabase();
 
   NS_DECL_ISUPPORTS_INHERITED 
   NS_DECL_NSINEWSDATABASE
 
   NS_IMETHOD Close(bool forceCommit) MOZ_OVERRIDE;
   NS_IMETHOD ForceClosed() MOZ_OVERRIDE;
   NS_IMETHOD Commit(nsMsgDBCommit commitType) MOZ_OVERRIDE;
   virtual uint32_t GetCurVersion() MOZ_OVERRIDE;
@@ -45,13 +44,14 @@ public:
   virtual nsresult  AdjustExpungedBytesOnDelete(nsIMsgDBHdr *msgHdr) MOZ_OVERRIDE;
   nsresult          SyncWithReadSet();
   
   NS_IMETHOD GetDefaultViewFlags(nsMsgViewFlagsTypeValue *aDefaultViewFlags) MOZ_OVERRIDE;
   NS_IMETHOD GetDefaultSortType(nsMsgViewSortTypeValue *aDefaultSortType) MOZ_OVERRIDE;
   NS_IMETHOD GetDefaultSortOrder(nsMsgViewSortOrderValue *aDefaultSortOrder) MOZ_OVERRIDE;
 
 protected:
+  virtual ~nsNewsDatabase();
   // this is owned by the nsNewsFolder, which lives longer than the db.
   nsMsgKeySet           *m_readSet;
 };
 
 #endif
--- a/mailnews/imap/src/nsImapIncomingServer.h
+++ b/mailnews/imap/src/nsImapIncomingServer.h
@@ -27,17 +27,16 @@ class nsImapIncomingServer : public nsMs
                              public nsIImapServerSink,
                              public nsISubscribableServer,
                              public nsIUrlListener
 {
 public:
     NS_DECL_ISUPPORTS_INHERITED
 
     nsImapIncomingServer();
-    virtual ~nsImapIncomingServer();
 
     // overriding nsMsgIncomingServer methods
   NS_IMETHOD SetKey(const nsACString& aKey) MOZ_OVERRIDE;  // override nsMsgIncomingServer's implementation...
   NS_IMETHOD GetLocalStoreType(nsACString& type) MOZ_OVERRIDE;
 
   NS_DECL_NSIIMAPINCOMINGSERVER
   NS_DECL_NSIIMAPSERVERSINK
   NS_DECL_NSISUBSCRIBABLESERVER
@@ -72,16 +71,17 @@ public:
   NS_IMETHOD GetMsgFolderFromURI(nsIMsgFolder *aFolderResource,
                                  const nsACString& aURI,
                                  nsIMsgFolder **aFolder) MOZ_OVERRIDE;
   NS_IMETHOD SetSocketType(int32_t aSocketType);
   NS_IMETHOD VerifyLogon(nsIUrlListener *aUrlListener, nsIMsgWindow *aMsgWindow,
                          nsIURI **aURL) MOZ_OVERRIDE;
 
 protected:
+  virtual ~nsImapIncomingServer();
   nsresult GetFolder(const nsACString& name, nsIMsgFolder** pFolder);
   virtual nsresult CreateRootFolderFromUri(const nsCString &serverUri,
                                            nsIMsgFolder **rootFolder) MOZ_OVERRIDE;
   nsresult ResetFoldersToUnverified(nsIMsgFolder *parentFolder);
   void GetUnverifiedSubFolders(nsIMsgFolder *parentFolder,
                                nsCOMArray<nsIMsgImapMailFolder> &aFoldersArray);
   void GetUnverifiedFolders(nsCOMArray<nsIMsgImapMailFolder> &aFolderArray);
   nsresult DeleteNonVerifiedFolders(nsIMsgFolder *parentFolder);
--- a/mailnews/imap/src/nsImapProtocol.h
+++ b/mailnews/imap/src/nsImapProtocol.h
@@ -132,17 +132,16 @@ class nsImapProtocol : public nsIImapPro
                        public nsIImapProtocolSink,
                        public nsIMsgAsyncPromptListener
 {
 public:
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIINPUTSTREAMCALLBACK
   nsImapProtocol();
-  virtual ~nsImapProtocol();
 
   virtual nsresult ProcessProtocolState(nsIURI * url, nsIInputStream * inputStream,
                                         uint64_t sourceOffset, uint32_t length) MOZ_OVERRIDE;
 
   // nsIRunnable method
   NS_IMETHOD Run() MOZ_OVERRIDE;
 
   //////////////////////////////////////////////////////////////////////////////////
@@ -307,16 +306,17 @@ public:
   void UpdateFolderQuotaData(nsCString& aQuotaRoot, uint32_t aUsed, uint32_t aMax);
 
   bool GetPreferPlainText() { return m_preferPlainText; }
 
   int32_t GetCurFetchSize() { return m_curFetchSize; }
 
   const nsString &GetEmptyMimePartString() { return m_emptyMimePartString; }
 private:
+  virtual ~nsImapProtocol();
   // the following flag is used to determine when a url is currently being run. It is cleared when we
   // finish processng a url and it is set whenever we call Load on a url
   bool m_urlInProgress;
   nsCOMPtr<nsIImapUrl> m_runningUrl; // the nsIImapURL that is currently running
   nsImapAction m_imapAction;  // current imap action associated with this connnection...
 
   nsCString             m_hostName;
   nsCString             m_userName;
--- a/mailnews/imap/src/nsImapUndoTxn.h
+++ b/mailnews/imap/src/nsImapUndoTxn.h
@@ -23,17 +23,16 @@
 class nsImapMoveCopyMsgTxn : public nsMsgTxn, nsIUrlListener
 {
 public:
 
   nsImapMoveCopyMsgTxn();
   nsImapMoveCopyMsgTxn(nsIMsgFolder* srcFolder, nsTArray<nsMsgKey>* srcKeyArray,
                        const char* srcMsgIdString, nsIMsgFolder* dstFolder,
                        bool isMove);
-  virtual ~nsImapMoveCopyMsgTxn();
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIURLLISTENER
 
   NS_IMETHOD UndoTransaction(void) MOZ_OVERRIDE;
   NS_IMETHOD RedoTransaction(void) MOZ_OVERRIDE;
 
   // helper
@@ -43,16 +42,17 @@ public:
   nsresult AddDstKey(nsMsgKey aKey);
   nsresult UndoMailboxDelete();
   nsresult RedoMailboxDelete();
   nsresult Init(nsIMsgFolder* srcFolder, nsTArray<nsMsgKey>* srcKeyArray,
                 const char* srcMsgIdString, nsIMsgFolder* dstFolder,
                 bool idsAreUids, bool isMove);
 
 protected:
+  virtual ~nsImapMoveCopyMsgTxn();
 
   nsWeakPtr m_srcFolder;
   nsCOMArray<nsIMsgDBHdr> m_srcHdrs;
   nsTArray<nsMsgKey> m_dupKeyArray;
   nsTArray<nsMsgKey> m_srcKeyArray;
   nsTArray<nsCString> m_srcMessageIds;
   nsCString m_srcMsgIdString;
   nsWeakPtr m_dstFolder;
@@ -72,21 +72,21 @@ class nsImapOfflineTxn : public nsImapMo
 {
 public:
   nsImapOfflineTxn(nsIMsgFolder* srcFolder, nsTArray<nsMsgKey>* srcKeyArray,
                    const char* srcMsgIdString,
                    nsIMsgFolder* dstFolder,
                    bool isMove,
                    nsOfflineImapOperationType opType,
                    nsCOMArray<nsIMsgDBHdr> &srcHdrs);
-  virtual ~nsImapOfflineTxn();
 
   NS_IMETHOD UndoTransaction(void) MOZ_OVERRIDE;
   NS_IMETHOD RedoTransaction(void) MOZ_OVERRIDE;
   void SetAddFlags(bool addFlags) {m_addFlags = addFlags;}
   void SetFlags(uint32_t flags) {m_flags = flags;}
 protected:
+  virtual ~nsImapOfflineTxn();
   nsOfflineImapOperationType m_opType;
   // these two are used to undo flag changes, which we don't currently do.
   bool m_addFlags;
   uint32_t m_flags;
 };
 #endif
--- a/mailnews/imap/src/nsImapUrl.h
+++ b/mailnews/imap/src/nsImapUrl.h
@@ -41,24 +41,24 @@ public:
   NS_IMETHOD GetFolder(nsIMsgFolder **aFolder) MOZ_OVERRIDE;
   NS_IMETHOD SetFolder(nsIMsgFolder *aFolder) MOZ_OVERRIDE;
   // nsIMsgMessageUrl
   NS_DECL_NSIMSGMESSAGEURL
   NS_DECL_NSIMSGI18NURL
 
   // nsImapUrl
   nsImapUrl();
-  virtual ~nsImapUrl();
 
   static nsresult ConvertToCanonicalFormat(const char *folderName, char onlineDelimiter, char **resultingCanonicalPath);
   static nsresult EscapeSlashes(const char *sourcePath, char **resultPath);
   static nsresult UnescapeSlashes(char *path);
   static char *  ReplaceCharsInCopiedString(const char *stringToCopy, char oldChar, char newChar);
 
 protected:
+  virtual ~nsImapUrl();
   virtual nsresult ParseUrl();
 
   char *m_listOfMessageIds;
 
   // handle the imap specific parsing
   void ParseImapPart(char *imapPartOfUrl);
 
   void ParseFolderPath(char **resultingCanonicalPath);
--- a/mailnews/local/src/nsLocalMailFolder.h
+++ b/mailnews/local/src/nsLocalMailFolder.h
@@ -91,17 +91,16 @@ struct nsLocalFolderScanState
 };
 
 class nsMsgLocalMailFolder : public nsMsgDBFolder,
                              public nsIMsgLocalMailFolder,
                              public nsICopyMessageListener
 {
 public:
   nsMsgLocalMailFolder(void);
-  virtual ~nsMsgLocalMailFolder(void);
   NS_DECL_NSICOPYMESSAGELISTENER
   NS_DECL_NSIMSGLOCALMAILFOLDER
   NS_DECL_NSIJUNKMAILCLASSIFICATIONLISTENER
   NS_DECL_ISUPPORTS_INHERITED
   // nsIRDFResource methods:
   NS_IMETHOD Init(const char *aURI) MOZ_OVERRIDE;
 
   // nsIUrlListener methods
@@ -169,16 +168,17 @@ public:
   NS_IMETHOD DownloadMessagesForOffline(nsIArray *aMessages, nsIMsgWindow *aWindow) MOZ_OVERRIDE;
   NS_IMETHOD FetchMsgPreviewText(nsMsgKey *aKeysToFetch, uint32_t aNumKeys,
                                                  bool aLocalOnly, nsIUrlListener *aUrlListener, 
                                                  bool *aAsyncResults) MOZ_OVERRIDE;
   NS_IMETHOD AddKeywordsToMessages(nsIArray *aMessages, const nsACString& aKeywords) MOZ_OVERRIDE;
   NS_IMETHOD RemoveKeywordsFromMessages(nsIArray *aMessages, const nsACString& aKeywords) MOZ_OVERRIDE;
 
 protected:
+  virtual ~nsMsgLocalMailFolder();
   nsresult CreateChildFromURI(const nsCString &uri, nsIMsgFolder **folder) MOZ_OVERRIDE;
   nsresult CopyFolderAcrossServer(nsIMsgFolder *srcFolder, nsIMsgWindow *msgWindow,nsIMsgCopyServiceListener* listener);
 
   nsresult CreateSubFolders(nsIFile *path);
   nsresult GetTrashFolder(nsIMsgFolder** trashFolder);
   nsresult WriteStartOfNewMessage();
 
   // CreateSubfolder, but without the nsIMsgFolderListener notification
--- a/mailnews/local/src/nsLocalUndoTxn.h
+++ b/mailnews/local/src/nsLocalUndoTxn.h
@@ -19,17 +19,16 @@
 #include "nsIWeakReferenceUtils.h"
 
 class nsLocalUndoFolderListener;
 
 class nsLocalMoveCopyMsgTxn : public nsIFolderListener, public nsMsgTxn
 {
 public:
     nsLocalMoveCopyMsgTxn();
-    virtual ~nsLocalMoveCopyMsgTxn();
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_NSIFOLDERLISTENER
 
     // overloading nsITransaction methods
     NS_IMETHOD UndoTransaction(void) MOZ_OVERRIDE;
     NS_IMETHOD RedoTransaction(void) MOZ_OVERRIDE;
 
     // helper
@@ -49,16 +48,17 @@ public:
     // If the store using this undo transaction can "undelete" a message,
     // it will call this function on the transaction; This makes undo/redo
     // easy because message keys don't change after undo/redo. Otherwise,
     // we need to adjust the src or dst keys after every undo/redo action
     // to note the new keys.
     void SetCanUndelete(bool canUndelete) {m_canUndelete = canUndelete;}
 
 private:
+    virtual ~nsLocalMoveCopyMsgTxn();
     nsWeakPtr m_srcFolder;
     nsTArray<nsMsgKey> m_srcKeyArray; // used when src is local or imap
     nsTArray<uint32_t> m_srcStatusOffsetArray; // used when src is local
     nsWeakPtr m_dstFolder;
     nsTArray<nsMsgKey> m_dstKeyArray;
     bool m_isMove;
     bool m_srcIsImap4;
     bool m_canUndelete;
--- a/mailnews/local/src/nsMailboxUrl.h
+++ b/mailnews/local/src/nsMailboxUrl.h
@@ -40,22 +40,22 @@ public:
 
   NS_IMETHOD GetFolder(nsIMsgFolder **msgFolder);
 
   // nsIMsgMailNewsUrl override
   NS_IMETHOD Clone(nsIURI **_retval) MOZ_OVERRIDE;
 
   // nsMailboxUrl
   nsMailboxUrl();
-  virtual ~nsMailboxUrl();
   NS_DECL_NSIMSGMESSAGEURL
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIMSGI18NURL
 
 protected:
+  virtual ~nsMailboxUrl();
   // protocol specific code to parse a url...
   virtual nsresult ParseUrl();
   nsresult GetMsgHdrForKey(nsMsgKey  msgKey, nsIMsgDBHdr ** aMsgHdr);
 
   // mailboxurl specific state
   nsCOMPtr<nsIStreamListener> m_mailboxParser;
   nsCOMPtr<nsIStreamListener> m_mailboxCopyHandler;
 
--- a/mailnews/local/src/nsMovemailIncomingServer.h
+++ b/mailnews/local/src/nsMovemailIncomingServer.h
@@ -19,20 +19,22 @@ class nsMovemailIncomingServer : public 
 
 {
 public:
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_NSIMOVEMAILINCOMINGSERVER
     NS_DECL_NSILOCALMAILINCOMINGSERVER
 
     nsMovemailIncomingServer();
-    virtual ~nsMovemailIncomingServer();
 
     NS_IMETHOD PerformBiff(nsIMsgWindow *aMsgWindow) MOZ_OVERRIDE;
     NS_IMETHOD GetDownloadMessagesAtStartup(bool *getMessages) MOZ_OVERRIDE;
     NS_IMETHOD GetCanBeDefaultServer(bool *canBeDefaultServer) MOZ_OVERRIDE;
     NS_IMETHOD GetCanSearchMessages(bool *canSearchMessages) MOZ_OVERRIDE;
     NS_IMETHOD GetServerRequiresPasswordForBiff(bool *aServerRequiresPasswordForBiff) MOZ_OVERRIDE;
     NS_IMETHOD GetAccountManagerChrome(nsAString& aResult) MOZ_OVERRIDE;
+
+private:
+    virtual ~nsMovemailIncomingServer();
 };
 
 
 #endif
--- a/mailnews/local/src/nsNoIncomingServer.h
+++ b/mailnews/local/src/nsNoIncomingServer.h
@@ -20,19 +20,21 @@ class nsNoIncomingServer : public nsMail
 
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSINOINCOMINGSERVER
   NS_DECL_NSILOCALMAILINCOMINGSERVER
 
   nsNoIncomingServer();
-  virtual ~nsNoIncomingServer();
 
   NS_IMETHOD GetLocalStoreType(nsACString& type) MOZ_OVERRIDE;
   NS_IMETHOD GetCanSearchMessages(bool *canSearchMessages) MOZ_OVERRIDE;
   NS_IMETHOD GetServerRequiresPasswordForBiff(bool *aServerRequiresPasswordForBiff) MOZ_OVERRIDE;
   NS_IMETHOD GetAccountManagerChrome(nsAString& aResult) MOZ_OVERRIDE;
   NS_IMETHOD GetSortOrder(int32_t* aSortOrder) MOZ_OVERRIDE;
+
+private:
+  virtual ~nsNoIncomingServer();
 };
 
 
 #endif
--- a/mailnews/local/src/nsParseMailbox.h
+++ b/mailnews/local/src/nsParseMailbox.h
@@ -127,17 +127,16 @@ protected:
 };
 
 // This class is part of the mailbox parsing state machine
 class nsMsgMailboxParser : public nsIStreamListener, public nsParseMailMessageState, public nsMsgLineBuffer
 {
 public:
   nsMsgMailboxParser(nsIMsgFolder *);
   nsMsgMailboxParser();
-  virtual ~nsMsgMailboxParser();
   nsresult Init();
 
   bool    IsRunningUrl() { return m_urlInProgress;} // returns true if we are currently running a url and false otherwise...
   NS_DECL_ISUPPORTS_INHERITED
 
   ////////////////////////////////////////////////////////////////////////////////////////
   // we suppport the nsIStreamListener interface
   ////////////////////////////////////////////////////////////////////////////////////////
@@ -159,16 +158,17 @@ public:
   void  UpdateDBFolderInfo(nsIMsgDatabase *mailDB);
   void  UpdateStatusText(const char* stringName);
 
   // Update the progress bar based on what we know.
   virtual void    UpdateProgressPercent ();
   virtual void OnNewMessage(nsIMsgWindow *msgWindow);
 
 protected:
+  virtual ~nsMsgMailboxParser();
   nsCOMPtr<nsIMsgStatusFeedback> m_statusFeedback;
 
   virtual int32_t     PublishMsgHeader(nsIMsgWindow *msgWindow);
   void                FreeBuffers();
 
   // data
   nsString        m_folderName;
   nsCString       m_inboxUri;
@@ -189,17 +189,16 @@ private:
 
 };
 
 class nsParseNewMailState : public nsMsgMailboxParser
 , public nsIMsgFilterHitNotify
 {
 public:
   nsParseNewMailState();
-  virtual ~nsParseNewMailState();
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_IMETHOD FinishHeader() MOZ_OVERRIDE;
 
   nsresult Init(nsIMsgFolder *rootFolder, nsIMsgFolder *downloadFolder,
                 nsIMsgWindow *aMsgWindow, nsIMsgDBHdr *aHdr,
                 nsIOutputStream *aOutputStream);
 
@@ -221,16 +220,17 @@ public:
                              uint32_t msgOffset);
   nsresult    ApplyForwardAndReplyFilter(nsIMsgWindow *msgWindow);
   virtual void OnNewMessage(nsIMsgWindow *msgWindow) MOZ_OVERRIDE;
 
   // this keeps track of how many messages we downloaded that
   // aren't new - e.g., marked read, or moved to an other server.
   int32_t     m_numNotNewMessages;
 protected:
+  virtual ~nsParseNewMailState();
   virtual nsresult GetTrashFolder(nsIMsgFolder **pTrashFolder);
   virtual nsresult MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
                                           nsIMsgDatabase *sourceDB,
                                           nsIMsgFolder *destIFolder,
                                           nsIMsgFilter *filter,
                                           nsIMsgWindow *msgWindow);
   virtual void     MarkFilteredMessageRead(nsIMsgDBHdr *msgHdr);
   virtual void     MarkFilteredMessageUnread(nsIMsgDBHdr *msgHdr);
--- a/mailnews/local/src/nsPop3IncomingServer.h
+++ b/mailnews/local/src/nsPop3IncomingServer.h
@@ -22,33 +22,33 @@ class nsPop3IncomingServer : public nsMa
 
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIPOP3INCOMINGSERVER
   NS_DECL_NSILOCALMAILINCOMINGSERVER
 
   nsPop3IncomingServer();
-  virtual ~nsPop3IncomingServer();
 
   NS_IMETHOD PerformBiff(nsIMsgWindow *aMsgWindow) MOZ_OVERRIDE;
   NS_IMETHOD GetDownloadMessagesAtStartup(bool *getMessages) MOZ_OVERRIDE;
   NS_IMETHOD GetCanBeDefaultServer(bool *canBeDefaultServer) MOZ_OVERRIDE;
   NS_IMETHOD GetCanSearchMessages(bool *canSearchMessages) MOZ_OVERRIDE;
   NS_IMETHOD GetOfflineSupportLevel(int32_t *aSupportLevel) MOZ_OVERRIDE;
   NS_IMETHOD CloseCachedConnections() MOZ_OVERRIDE;
   NS_IMETHOD GetRootMsgFolder(nsIMsgFolder **aRootMsgFolder) MOZ_OVERRIDE;
   NS_IMETHOD GetCanFileMessagesOnServer(bool *aCanFileMessagesOnServer) MOZ_OVERRIDE;
   NS_IMETHOD GetCanCreateFoldersOnServer(bool *aCanCreateFoldersOnServer) MOZ_OVERRIDE;
   NS_IMETHOD VerifyLogon(nsIUrlListener *aUrlListener, nsIMsgWindow *aMsgWindow,
                          nsIURI **aURL) MOZ_OVERRIDE;
   NS_IMETHOD GetNewMessages(nsIMsgFolder *aFolder, nsIMsgWindow *aMsgWindow,
                             nsIUrlListener *aUrlListener) MOZ_OVERRIDE;
 
 protected:
+  virtual ~nsPop3IncomingServer();
   nsresult GetInbox(nsIMsgWindow *msgWindow, nsIMsgFolder **inbox);
 
 private:
   uint32_t m_capabilityFlags;
   bool m_authenticated;
   nsCOMPtr <nsIPop3Protocol> m_runningProtocol;
   nsCOMPtr <nsIMsgFolder> m_rootMsgFolder;
   nsVoidArray m_uidlsToMark;
--- a/mailnews/local/src/nsPop3Protocol.h
+++ b/mailnews/local/src/nsPop3Protocol.h
@@ -250,17 +250,16 @@ typedef struct _Pop3ConData {
 
 
 class nsPop3Protocol : public nsMsgProtocol,
                        public nsIPop3Protocol,
                        public nsIMsgAsyncPromptListener
 {
 public:
   nsPop3Protocol(nsIURI* aURL);
-  virtual ~nsPop3Protocol();
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIPOP3PROTOCOL
   NS_DECL_NSIMSGASYNCPROMPTLISTENER
 
   nsresult Initialize(nsIURI * aURL);
   virtual nsresult LoadUrl(nsIURI *aURL, nsISupports * aConsumer = nullptr) MOZ_OVERRIDE;
   void Cleanup();
@@ -276,16 +275,17 @@ public:
 
   static void MarkMsgInHashTable(PLHashTable *hashTable, const Pop3UidlEntry *uidl,
                                   bool *changed);
 
   static nsresult MarkMsgForHost(const char *hostName, const char *userName,
                                       nsIFile *mailDirectory,
                                       nsVoidArray  &UIDLArray);
 private:
+  virtual ~nsPop3Protocol();
   nsCString m_ApopTimestamp;
   nsCOMPtr<nsIStringBundle> mLocalBundle;
 
   nsCString m_username;
   nsCString m_senderInfo;
   nsCString m_commandResponse;
   nsCString m_GSSAPICache;
 
--- a/mailnews/local/src/nsRssIncomingServer.h
+++ b/mailnews/local/src/nsRssIncomingServer.h
@@ -28,16 +28,16 @@ public:
     NS_IMETHOD GetSupportsDiskSpace(bool *aSupportsDiskSpace) MOZ_OVERRIDE;
     NS_IMETHOD GetAccountManagerChrome(nsAString& aResult) MOZ_OVERRIDE;
     NS_IMETHOD PerformBiff(nsIMsgWindow *aMsgWindow) MOZ_OVERRIDE;
     NS_IMETHOD GetServerRequiresPasswordForBiff(bool *aServerRequiresPasswordForBiff) MOZ_OVERRIDE;
     NS_IMETHOD GetCanSearchMessages(bool *canSearchMessages) MOZ_OVERRIDE;
     NS_IMETHOD GetSortOrder(int32_t* aSortOrder) MOZ_OVERRIDE;
 
     nsRssIncomingServer();
+protected:
     virtual ~nsRssIncomingServer();
-protected:
     nsresult FolderChanged(nsIMsgFolder *aFolder, nsIMsgFolder *aOrigFolder, const char *aAction);
     nsresult FillInDataSourcePath(const nsAString& aDataSourceName, nsIFile ** aLocation);
     static nsrefcnt gInstanceCount;
 };
 
 #endif /* __nsRssIncomingServer_h */
--- a/mailnews/news/src/nsNNTPProtocol.h
+++ b/mailnews/news/src/nsNNTPProtocol.h
@@ -132,32 +132,32 @@ public:
   NS_DECL_NSICACHELISTENER
   NS_DECL_NSITIMERCALLBACK
   NS_DECL_NSIMSGASYNCPROMPTLISTENER
 
   // Creating a protocol instance requires the URL
   // need to call Initialize after we do a new of nsNNTPProtocol
   nsNNTPProtocol(nsINntpIncomingServer *aServer, nsIURI *aURL,
                  nsIMsgWindow *aMsgWindow);
-  virtual ~nsNNTPProtocol();
 
   // stop binding is a "notification" informing us that the stream associated with aURL is going away.
   NS_IMETHOD OnStopRequest(nsIRequest *request, nsISupports * aCtxt, nsresult aStatus);
 
   char * m_ProxyServer;    /* proxy server hostname */
 
   NS_IMETHOD Cancel(nsresult status);  // handle stop button
   NS_IMETHOD GetContentType(nsACString &aContentType);
   NS_IMETHOD AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt);
   NS_IMETHOD GetOriginalURI(nsIURI* *aURI);
   NS_IMETHOD SetOriginalURI(nsIURI* aURI);
 
   nsresult LoadUrl(nsIURI * aURL, nsISupports * aConsumer);
 
 private:
+  virtual ~nsNNTPProtocol();
   /**
    * Triggers the protocol state machine.
    * Most of the time, this machine will read as much input as it can before
    * closing.
    *
    * This method additionally handles some states not covered by other methods:
    * NEWS_DONE: Alias for NEWS_FREE
    * NEWS_POST_DONE: Alias for NEWS_FREE that cleans up the URL state
--- a/mailnews/news/src/nsNewsFolder.h
+++ b/mailnews/news/src/nsNewsFolder.h
@@ -20,17 +20,16 @@
 #include "nsCOMPtr.h"
 #include "nsIMsgFilterService.h"
 #include "nsIArray.h"
 
 class nsMsgNewsFolder : public nsMsgDBFolder, public nsIMsgNewsFolder
 {
 public:
   nsMsgNewsFolder(void);
-  virtual ~nsMsgNewsFolder(void);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIMSGNEWSFOLDER
 
   // nsIUrlListener method
   NS_IMETHOD OnStopRunningUrl(nsIURI * aUrl, nsresult aExitCode) MOZ_OVERRIDE;
   // nsIMsgFolder methods:
   NS_IMETHOD GetSubFolders(nsISimpleEnumerator **aResult) MOZ_OVERRIDE;
@@ -88,16 +87,17 @@ public:
                            nsIMsgFilterList **aFilterList) MOZ_OVERRIDE;
   NS_IMETHOD GetEditableFilterList(nsIMsgWindow *aMsgWindow,
                                    nsIMsgFilterList **aFilterList) MOZ_OVERRIDE;
   NS_IMETHOD SetFilterList(nsIMsgFilterList *aFilterList) MOZ_OVERRIDE;
   NS_IMETHOD SetEditableFilterList(nsIMsgFilterList *aFilterList) MOZ_OVERRIDE;
   NS_IMETHOD ApplyRetentionSettings() MOZ_OVERRIDE;
 
 protected:
+  virtual ~nsMsgNewsFolder();
   // helper routine to parse the URI and update member variables
   nsresult AbbreviatePrettyName(nsAString& prettyName, int32_t fullwords);
   nsresult ParseFolder(nsIFile *path);
   nsresult CreateSubFolders(nsIFile *path);
   nsresult AddDirectorySeparator(nsIFile *path);
   nsresult GetDatabase() MOZ_OVERRIDE;
   virtual nsresult CreateChildFromURI(const nsCString &uri,
                                       nsIMsgFolder **folder) MOZ_OVERRIDE;
--- a/mailnews/news/src/nsNntpIncomingServer.h
+++ b/mailnews/news/src/nsNntpIncomingServer.h
@@ -42,17 +42,16 @@ class nsNntpIncomingServer : public nsMs
 public:
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_NSINNTPINCOMINGSERVER
     NS_DECL_NSIURLLISTENER
     NS_DECL_NSISUBSCRIBABLESERVER
     NS_DECL_NSITREEVIEW
 
     nsNntpIncomingServer();
-    virtual ~nsNntpIncomingServer();
 
     NS_IMETHOD GetLocalStoreType(nsACString& type);
     NS_IMETHOD CloseCachedConnections();
     NS_IMETHOD PerformBiff(nsIMsgWindow *aMsgWindow);
     NS_IMETHOD PerformExpand(nsIMsgWindow *aMsgWindow);
     NS_IMETHOD OnUserOrHostNameChanged(const nsACString& oldName,
                                        const nsACString& newName,
                                        bool hostnameChanged);
@@ -70,16 +69,17 @@ public:
     NS_IMETHOD GetFilterScope(nsMsgSearchScopeValue *filterScope);
     NS_IMETHOD GetSearchScope(nsMsgSearchScopeValue *searchScope);
 
     NS_IMETHOD GetSocketType(int32_t *aSocketType); // override nsMsgIncomingServer impl
     NS_IMETHOD SetSocketType(int32_t aSocketType); // override nsMsgIncomingServer impl
     NS_IMETHOD GetSortOrder(int32_t* aSortOrder);
 
 protected:
+    virtual ~nsNntpIncomingServer();
    virtual nsresult CreateRootFolderFromUri(const nsCString &serverUri,
                                             nsIMsgFolder **rootFolder);
     nsresult GetNntpConnection(nsIURI *url, nsIMsgWindow *window,
                                nsINNTPProtocol **aNntpConnection);
     nsresult CreateProtocolInstance(nsINNTPProtocol **aNntpConnection,
                                     nsIURI *url, nsIMsgWindow *window);
     bool ConnectionTimeOut(nsINNTPProtocol* aNntpConnection);
     nsCOMArray<nsINNTPProtocol> mConnectionCache;
--- a/mailnews/news/src/nsNntpUrl.h
+++ b/mailnews/news/src/nsNntpUrl.h
@@ -25,21 +25,21 @@ public:
 
   // nsIMsgMailNewsUrl overrides
   NS_IMETHOD GetServer(nsIMsgIncomingServer **server);
   NS_IMETHOD GetFolder(nsIMsgFolder **msgFolder);
   NS_IMETHOD Clone(nsIURI **_retval);
 
   // nsNntpUrl
   nsNntpUrl();
-  virtual ~nsNntpUrl();
 
   NS_DECL_ISUPPORTS_INHERITED
 
 private:
+  virtual ~nsNntpUrl();
   nsresult DetermineNewsAction();
   nsresult ParseNewsURL();
   nsresult ParseNntpURL();
 
   nsCOMPtr<nsINNTPNewsgroupPost> m_newsgroupPost;
   nsNewsAction m_newsAction; // the action this url represents...parse mailbox, display messages, etc.
 
   nsCString mURI; // the RDF URI associated with this url.