From 990168e923dea138f5db0f3fa88823f3791fabff Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 7 Feb 2009 23:10:56 +0000 Subject: [PATCH] fix wxList::erase(it, end()) in non-STL build (see #10103) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@58734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + include/wx/list.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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; \ } \