From 7b235d47c0573872288f24827adc2945aca4bde0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 25 May 2000 18:34:49 +0000 Subject: [PATCH] fix for wxObjectArray::Clear() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/arrimpl.cpp | 8 +++----- include/wx/dynarray.h | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/wx/arrimpl.cpp b/include/wx/arrimpl.cpp index 6496ca6b75..cf1e290613 100644 --- a/include/wx/arrimpl.cpp +++ b/include/wx/arrimpl.cpp @@ -57,21 +57,19 @@ name::name(const name& src) \ DoCopy(src); \ } \ \ -void name::Empty() \ +void name::DoEmpty() \ { \ for ( size_t ui = 0; ui < Count(); ui++ ) \ delete (T*)wxBaseArray::Item(ui); \ - \ - wxBaseArray::Clear(); \ } \ \ -void name::RemoveAt(size_t uiIndex) \ +void name::RemoveAt(size_t uiIndex) \ { \ wxCHECK_RET( uiIndex < Count(), _WX_ERROR_REMOVE2(name) ); \ \ delete (T*)wxBaseArray::Item(uiIndex); \ \ - wxBaseArray::RemoveAt(uiIndex); \ + wxBaseArray::RemoveAt(uiIndex); \ } \ \ void name::Add(const T& item) \ diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index 109a89437c..0ee90cc88b 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -304,7 +304,8 @@ public: \ void Insert(const T* pItem, size_t uiIndex) \ { wxBaseArray::Insert((long)pItem, uiIndex); } \ \ - void Empty(); \ + void Empty() { DoEmpty(); wxBaseArray::Empty(); } \ + void Clear() { DoEmpty(); wxBaseArray::Clear(); } \ \ T* Detach(size_t uiIndex) \ { T* p = (T*)wxBaseArray::Item(uiIndex); \ @@ -315,6 +316,7 @@ public: \ void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \ \ private: \ + void DoEmpty(); \ void DoCopy(const name& src); \ }