From 616825ec4bed7995505c117ae4bbb55aeb372aed Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 20 Jul 2012 21:42:16 +0000 Subject: [PATCH] fixed possible bug due to misplaced mutex (Reported by bNK) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5318 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/services/p3bwctrl.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/services/p3bwctrl.cc b/libretroshare/src/services/p3bwctrl.cc index c823c72ea..f0e3f83c2 100644 --- a/libretroshare/src/services/p3bwctrl.cc +++ b/libretroshare/src/services/p3bwctrl.cc @@ -300,10 +300,11 @@ void p3BandwidthControl::statusChange(const std::list &plist) { if (it->state & RS_PEER_S_FRIEND) { + RsStackMutex stack(mBwMtx); /****** LOCKED MUTEX *******/ + if (it->actions & RS_PEER_DISCONNECTED) { /* remove from map */ - RsStackMutex stack(mBwMtx); /****** LOCKED MUTEX *******/ std::map::iterator bit; bit = mBwMap.find(it->id); if (bit == mBwMap.end())