Ticket #4793: mythtv_tvchain_pginfo_leak2.diff

File mythtv_tvchain_pginfo_leak2.diff, 869 bytes (added by Shane Shrybman <gnome42@…>, 12 years ago)

pginfo leak plus small optimizations

  • libs/libmythtv/livetvchain.cpp

     
    401401        return NULL;
    402402
    403403    // Skip dummy recordings, if possible.
    404     if (entry.cardtype == "DUMMY")
     404    if (entry.cardtype == "DUMMY" &&
     405        m_switchid != m_curpos)
    405406    {
    406407        if (m_switchid > m_curpos && m_switchid + 1 < (int)m_chain.count())
    407408            m_switchid++;
     
    409410            m_switchid--;
    410411
    411412        GetEntryAt(m_switchid, entry);
     413        delete pginfo;
    412414        pginfo = EntryToProgram(entry);
     415
     416        if (!pginfo)
     417            return NULL;
    413418    }
    414419
    415     if (!pginfo)
    416         return NULL;
    417 
    418420    discont = true;
    419421    if (m_curpos == m_switchid - 1)
    420422        discont = entry.discontinuity;