Commit b4e0a5cb authored by Kirill Mavreshko's avatar Kirill Mavreshko Committed by Maciej Suminski

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

parent 4cd4990b
......@@ -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;
}
......
......@@ -1216,12 +1216,19 @@ 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment