sectionsd: don't take any chances in deleteEvent()

Just take the write lock right away, to make sure nothing changes the
event lists behind our backs and possibly corrupts the iterator.

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1392 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
seife
2011-04-11 17:17:39 +00:00
parent c5ae25e66d
commit df3d2fbc3b

View File

@@ -652,21 +652,17 @@ static void addBouquetFilter(t_bouquet_id bid)
// Loescht ein Event aus allen Mengen
static bool deleteEvent(const event_id_t uniqueKey)
{
readLockEvents();
writeLockEvents();
MySIeventsOrderUniqueKey::iterator e = mySIeventsOrderUniqueKey.find(uniqueKey);
if (e != mySIeventsOrderUniqueKey.end())
{
if (e->second->times.size())
{
unlockEvents();
writeLockEvents();
mySIeventsOrderFirstEndTimeServiceIDEventUniqueKey.erase(e->second);
mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.erase(e->second);
}
unlockEvents();
writeLockEvents();
mySIeventsOrderUniqueKey.erase(uniqueKey);
mySIeventsNVODorderUniqueKey.erase(uniqueKey);