diff --git a/docs/changes.txt b/docs/changes.txt index 69a0aa8900..5e6576f292 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -96,6 +96,7 @@ All: - wxHashMap::insert() doesn't update the value if it didn't insert the element any more (Marcin Malich). - Correct bug in wxTimeSpan::Format() for negative spans. +- Correct several bugs in wxList using end() iterators (Suzumizaki-Kimitaka). - Added Vietnamese translation (Tran Ngoc Quan). - Updated Slovenian translation (Martin Srebotnjak). - Corrected Serbian locale name (Cody Precord). diff --git a/include/wx/list.h b/include/wx/list.h index a62d9a4436..9d043c77b2 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -1055,7 +1055,9 @@ private: } \ iterator erase(const iterator& first, const iterator& last) \ { \ - iterator next = last; ++next; \ + iterator next = last; \ + if ( next != end() ) \ + ++next; \ DeleteNodes(first.m_node, last.m_node); \ return next; \ } \