From 6aa33060cd9132116fa3431b4889342e2f655853 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sat, 8 May 2004 09:33:29 +0000 Subject: [PATCH] Fix for pure virtual method call caused by wxHashTable not overriding virtual destructor. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27168 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/hash.h | 6 ++++-- src/common/hash.cpp | 7 +------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/wx/hash.h b/include/wx/hash.h index 851ce62231..194302ae7a 100644 --- a/include/wx/hash.h +++ b/include/wx/hash.h @@ -159,7 +159,7 @@ public: typedef wxHashTableBase_Node Node; wxHashTableBase(); - virtual ~wxHashTableBase(); + virtual ~wxHashTableBase() { }; void Create( wxKeyType keyType = wxKEY_INTEGER, size_t size = wxHASH_SIZE_DEFAULT ); @@ -344,6 +344,8 @@ public: : wxHashTableBase() { Create( keyType, size ); BeginFind(); } wxHashTable( const wxHashTable& table ); + virtual ~wxHashTable() { Destroy(); } + const wxHashTable& operator=( const wxHashTable& ); void Destroy() { Clear(); } @@ -514,7 +516,7 @@ private: size_t size = wxHASH_SIZE_DEFAULT) \ : wxHashTableBase() { Create(keyType, size); } \ \ - ~hashclass() { Destroy(); } \ + virtual ~hashclass() { Destroy(); } \ \ void Destroy() { Clear(); } \ void Put(long key, eltype *data) { DoPut(key, key, (void*)data); } \ diff --git a/src/common/hash.cpp b/src/common/hash.cpp index abcc84f7c8..28ba8276da 100644 --- a/src/common/hash.cpp +++ b/src/common/hash.cpp @@ -753,11 +753,6 @@ wxHashTableBase::wxHashTableBase() { } -wxHashTableBase::~wxHashTableBase() -{ - Destroy(); -} - void wxHashTableBase::Create( wxKeyType keyType, size_t size ) { m_keyType = keyType; @@ -1038,7 +1033,7 @@ const wxHashTable& wxHashTable::operator=( const wxHashTable& table ) return *this; } -void wxHashTable::DoCopy( const wxHashTable& table ) +void wxHashTable::DoCopy( const wxHashTable& WXUNUSED(table) ) { Create( m_keyType, m_size ); -- 2.45.2