Fixes bug #1332438: PNS router crashes when you another track while routing in "shove" mode

This commit is contained in:
Kirill Mavreshko 2014-06-23 08:50:53 +02:00 committed by Maciej Suminski
parent 4cd4990bc2
commit b4e0a5cbbf
2 changed files with 9 additions and 2 deletions

View File

@ -112,7 +112,7 @@ public:
LINKED_ITEMS::iterator f = std::find( m_linkedItems.begin(), m_linkedItems.end(), aItem );
if( f != m_linkedItems.end() )
m_linkedItems.erase( f );
f = m_linkedItems.erase( f );
return m_linkedItems.size() == 0;
}

View File

@ -1216,14 +1216,21 @@ int PNS_NODE::FindByMarker( int aMarker, PNS_ITEMSET& aItems )
int PNS_NODE::RemoveByMarker( int aMarker )
{
std::list<PNS_ITEM*> garbage;
for( PNS_INDEX::ITEM_SET::iterator i = m_index->begin(); i != m_index->end(); ++i )
{
if ( (*i)->Marker() & aMarker )
{
Remove( *i );
garbage.push_back( *i );
}
}
for( std::list<PNS_ITEM*>::const_iterator i = garbage.begin(), end = garbage.end(); i != end; ++i )
{
Remove( *i );
}
return 0;
}