From f6c6af8b59d81e8314491746170e86b9e8745f7d Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 10 May 2012 19:04:31 +0000 Subject: [PATCH] removed non-mutex-protected reference git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5157 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/turtle/p3turtle.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 19933cc97..73d9fad25 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -1950,6 +1950,7 @@ void p3turtle::handleTunnelResult(RsTurtleTunnelOkItem *item) { bool new_tunnel = false ; TurtleFileHash new_hash ; + std::string new_vpid ; { RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/ @@ -2043,6 +2044,7 @@ void p3turtle::handleTunnelResult(RsTurtleTunnelOkItem *item) new_hash = it->first ; locked_addDistantPeer(new_hash,item->tunnel_id) ; + new_vpid = _local_tunnels[item->tunnel_id].vpid ; // save it for off-mutex usage. } if(!found) std::cerr << "p3turtle: error. Could not find hash that emmitted tunnel request " << (void*)item->tunnel_id << std::endl ; @@ -2065,7 +2067,7 @@ void p3turtle::handleTunnelResult(RsTurtleTunnelOkItem *item) // if(new_tunnel) { - _ft_controller->addFileSource(new_hash,_local_tunnels[item->tunnel_id].vpid) ; + _ft_controller->addFileSource(new_hash,new_vpid) ; _ft_controller->statusChange(_online_peers) ; } }