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
This commit is contained in:
Vadim Zeitlin
2000-05-25 18:34:49 +00:00
parent b0d2cd55b4
commit 7b235d47c0
2 changed files with 6 additions and 6 deletions

View File

@@ -57,12 +57,10 @@ 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) \

View File

@@ -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); \
}