mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-04 12:18:33 +02:00
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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user