aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Amland <thomas.amland@gmail.com>2016-04-01 12:00:45 +0200
committerThomas Amland <thomas.amland@gmail.com>2016-04-23 15:52:14 +0200
commit6a7719fcfdbf6b86acf03f0426cd99dd5ad10624 (patch)
tree4c1e3bbc0ba66ee89a198944641488d83b29af5a
parent86e43ca13b49381a5803579d4e3be404b6cca1da (diff)
[peripherals] dont hold internal locks when triggering device scan. fixes deadlock
-rw-r--r--xbmc/peripherals/Peripherals.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/xbmc/peripherals/Peripherals.cpp b/xbmc/peripherals/Peripherals.cpp
index 87a368d0cf..3a27fdca08 100644
--- a/xbmc/peripherals/Peripherals.cpp
+++ b/xbmc/peripherals/Peripherals.cpp
@@ -165,8 +165,13 @@ void CPeripherals::Clear()
void CPeripherals::TriggerDeviceScan(const PeripheralBusType type /* = PERIPHERAL_BUS_UNKNOWN */)
{
- CSingleLock lock(m_critSectionBusses);
- for (auto& bus : m_busses)
+ std::vector<PeripheralBusPtr> busses;
+ {
+ CSingleLock lock(m_critSectionBusses);
+ busses = m_busses;
+ }
+
+ for (auto& bus : busses)
{
bool bScan = false;