mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
removed possibility to access invalidated iterator in grouter
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8435 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ca07e1415d
commit
50eff71bfa
@ -656,13 +656,6 @@ void p3GRouter::removeVirtualPeer(const TurtleFileHash& hash,const TurtleVirtual
|
|||||||
}
|
}
|
||||||
it->second.removeVirtualPeer(virtual_peer_id) ;
|
it->second.removeVirtualPeer(virtual_peer_id) ;
|
||||||
|
|
||||||
if(it->second.virtual_peers.empty())
|
|
||||||
{
|
|
||||||
#ifdef GROUTER_DEBUG
|
|
||||||
std::cerr << " last virtual peer removed. Also deleting hash entry." << std::endl;
|
|
||||||
#endif
|
|
||||||
_tunnels.erase(it) ;
|
|
||||||
}
|
|
||||||
#ifdef GROUTER_DEBUG
|
#ifdef GROUTER_DEBUG
|
||||||
std::cerr << " setting tunnel status in pending message." << std::endl;
|
std::cerr << " setting tunnel status in pending message." << std::endl;
|
||||||
#endif
|
#endif
|
||||||
@ -670,6 +663,15 @@ void p3GRouter::removeVirtualPeer(const TurtleFileHash& hash,const TurtleVirtual
|
|||||||
for(std::map<GRouterMsgPropagationId,GRouterRoutingInfo>::iterator it2(_pending_messages.begin());it2!=_pending_messages.end();++it2)
|
for(std::map<GRouterMsgPropagationId,GRouterRoutingInfo>::iterator it2(_pending_messages.begin());it2!=_pending_messages.end();++it2)
|
||||||
if(it2->second.tunnel_hash == hash && it->second.virtual_peers.empty())
|
if(it2->second.tunnel_hash == hash && it->second.virtual_peers.empty())
|
||||||
it2->second.tunnel_status = RS_GROUTER_TUNNEL_STATUS_PENDING ;
|
it2->second.tunnel_status = RS_GROUTER_TUNNEL_STATUS_PENDING ;
|
||||||
|
|
||||||
|
if(it->second.virtual_peers.empty())
|
||||||
|
{
|
||||||
|
#ifdef GROUTER_DEBUG
|
||||||
|
std::cerr << " last virtual peer removed. Also deleting hash entry." << std::endl;
|
||||||
|
#endif
|
||||||
|
_tunnels.erase(it) ;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void p3GRouter::connectToTurtleRouter(p3turtle *pt)
|
void p3GRouter::connectToTurtleRouter(p3turtle *pt)
|
||||||
|
Loading…
Reference in New Issue
Block a user