Fix crash when writing epg cache to the disk
[openblackhole/openblackhole-enigma2.git] / lib / dvb / epgcache.cpp
index 05dfd68..d42053c 100644 (file)
@@ -3560,10 +3560,12 @@ void eEPGCache::privateSectionRead(const uniqueEPGKey &current_service, const ui
                eventMap::iterator evIt( evMap.find(it->second.second) );
                if ( evIt != evMap.end() )
                {
+                       // time_event_map can have other timestamp -> get timestamp from eventData
+                       time_t ev_time = evIt->second->getStartTime();
                        delete evIt->second;
                        evMap.erase(evIt);
+                       tmMap.erase(ev_time);
                }
-               tmMap.erase(it->second.first);
        }
        time_event_map.clear();