void CPVREpgs::Clear(bool bClearDb /* = false */) { /* remove all pointers to epg tables on timers */ for (unsigned int iTimerPtr = 0; iTimerPtr < PVRTimers.size(); iTimerPtr++) PVRTimers[iTimerPtr].SetEpgInfoTag(NULL); /* clear all epg tables and remove pointers to epg tables on channels */ for (unsigned int iEpgPtr = 0; iEpgPtr < size(); iEpgPtr++) { CPVREpg *epg = at(iEpgPtr); epg->Clear(); CPVRChannel *channel = (CPVRChannel *) epg->Channel(); if (channel) channel->m_EPG = NULL; } /* remove all EPG tables */ clear(); /* clear the database entries */ if (bClearDb) { CPVRDatabase *database = g_PVRManager.GetTVDatabase(); database->Open(); database->EraseEpg(); database->Close(); } m_iLastEpgUpdate = 0; m_bDatabaseLoaded = false; }