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


Origin commit data
------------------
Commit: df3d2fbc3b
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2011-04-11 (Mon, 11 Apr 2011)
This commit is contained in:
Stefan Seyfried
2011-04-11 17:17:39 +00:00
parent 3c92a3d815
commit d2dd113d9a

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);