X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c67451472112b3c7bb3b425cfab523b2d38d0cf..34dceb471562e2bf2cc85c4792cde3faf555af40:/src/generic/accel.cpp?ds=sidebyside diff --git a/src/generic/accel.cpp b/src/generic/accel.cpp index bede8f488c..edf52970cd 100644 --- a/src/generic/accel.cpp +++ b/src/generic/accel.cpp @@ -55,16 +55,19 @@ class wxAccelRefData : public wxObjectRefData public: wxAccelRefData() { - m_accels.DeleteContents(TRUE); } wxAccelRefData(const wxAccelRefData& data) : wxObjectRefData() { - m_accels.DeleteContents(TRUE); m_accels = data.m_accels; } + virtual ~wxAccelRefData() + { + WX_CLEAR_LIST(wxAccelList, m_accels); + } + wxAccelList m_accels; }; @@ -133,14 +136,15 @@ void wxAcceleratorTable::Remove(const wxAcceleratorEntry& entry) { AllocExclusive(); - wxAccelList::Node *node = M_ACCELDATA->m_accels.GetFirst(); + wxAccelList::compatibility_iterator node = M_ACCELDATA->m_accels.GetFirst(); while ( node ) { const wxAcceleratorEntry *entryCur = node->GetData(); if ( *entryCur == entry ) { - M_ACCELDATA->m_accels.DeleteNode(node); + delete node->GetData(); + M_ACCELDATA->m_accels.Erase(node); return; } @@ -164,7 +168,7 @@ wxAcceleratorTable::GetEntry(const wxKeyEvent& event) const return NULL; } - wxAccelList::Node *node = M_ACCELDATA->m_accels.GetFirst(); + wxAccelList::compatibility_iterator node = M_ACCELDATA->m_accels.GetFirst(); while ( node ) { const wxAcceleratorEntry *entry = node->GetData();