Permalink
Browse files

[pvr] add missing lock in IsConnectedClient()

  • Loading branch information...
1 parent d68300f commit 4b9ccd6f5782a302f4e7142092fcbb41f38875c7 @Jalle19 Jalle19 committed Nov 11, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 xbmc/pvr/addons/PVRClients.cpp
@@ -97,6 +97,8 @@ bool CPVRClients::IsConnectedClient(int iClientId) const
bool CPVRClients::IsConnectedClient(const AddonPtr addon)
{
+ CSingleLock lock(m_critSection);
+
for (PVR_CLIENTMAP_CITR itr = m_clientMap.begin(); itr != m_clientMap.end(); itr++)
if (itr->second->ID() == addon->ID())
return itr->second->ReadyToUse();
@@ -367,9 +369,11 @@ bool CPVRClients::GetPlayingRecording(CPVRRecording &recording) const
bool CPVRClients::HasTimerSupport(int iClientId)
{
- CSingleLock lock(m_critSection);
+ PVR_CLIENT client;
+ if (GetConnectedClient(iClientId, client))
+ return client->SupportsTimers();
- return IsConnectedClient(iClientId) && m_clientMap[iClientId]->SupportsTimers();
+ return false;
}
PVR_ERROR CPVRClients::GetTimers(CPVRTimers *timers)

0 comments on commit 4b9ccd6

Please sign in to comment.