* CID 532 and 533: calling erase on an iterator invalidates it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38041 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -104,8 +104,8 @@ status_t _ViewEntry::add(BView* pView, const tip_entry& tipEntry) {
|
|||||||
// [e.moon 13oct99] ref'd by pointer
|
// [e.moon 13oct99] ref'd by pointer
|
||||||
tip_entry_set::iterator itFound = viewEntry->m_tips.find(newTipEntry);
|
tip_entry_set::iterator itFound = viewEntry->m_tips.find(newTipEntry);
|
||||||
if(itFound != viewEntry->m_tips.end()) {
|
if(itFound != viewEntry->m_tips.end()) {
|
||||||
viewEntry->m_tips.erase(itFound);
|
|
||||||
delete *itFound;
|
delete *itFound;
|
||||||
|
viewEntry->m_tips.erase(itFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
pair<tip_entry_set::iterator, bool> ret;
|
pair<tip_entry_set::iterator, bool> ret;
|
||||||
@@ -163,10 +163,10 @@ status_t _ViewEntry::remove(
|
|||||||
tip_entry matchEntry(rect);
|
tip_entry matchEntry(rect);
|
||||||
tip_entry_set::iterator it = viewEntry->m_tips.lower_bound(&matchEntry);
|
tip_entry_set::iterator it = viewEntry->m_tips.lower_bound(&matchEntry);
|
||||||
tip_entry_set::iterator itEnd = viewEntry->m_tips.upper_bound(&matchEntry);
|
tip_entry_set::iterator itEnd = viewEntry->m_tips.upper_bound(&matchEntry);
|
||||||
for(; it != itEnd; ++it) {
|
while(it != itEnd) {
|
||||||
// found one; erase it
|
// found one; erase it
|
||||||
delete *it;
|
delete *it;
|
||||||
viewEntry->m_tips.erase(it);
|
viewEntry->m_tips.erase(it++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user