[mythtv-commits] mythtv commit: r25080 by mdean

mythtv at cvs.mythtv.org mythtv at cvs.mythtv.org
Thu Jun 10 20:41:00 UTC 2010

      Author: mdean
        Date: 2010-06-10 20:41:00 +0000 (Thu, 10 Jun 2010)
New Revision: 25080
   Changeset: http://svn.mythtv.org/trac/changeset/25080




Fix a segfault in MythXML's GetExpiring method caused by a NULL AutoExpire pointer and re-enable the use of the Scheduler in MythXML.

Since http://svn.mythtv.org/trac/changeset/24030 , the global MediaServer g_pUPnp is created early in backend startup to allow its use for mythbackend settings.  This means g_pUPnp is instantiated before the global AutoExpire expirer and the global Scheduler sched.  The MediaServer creates the MythXML object referenced by UPnp::m_pHttpServer, which stores a copy of the global sched and expirer pointers' current values into m_pSched and m_pExpirer, respectively.  Since the global objects have not yet been created, m_pSched and m_pExpirer are always NULL.

This change modifies MythXML to use the global pointers directly.  Although all uses of the scheduler were wrapped in a NULL check and, therefore, didn't cause segfaults, this change re-enables receiving scheduler-related information from MythXML.  Use of the AutoExpire pointer, however, wasn't wrapped in a NULL check and would always result in a segfault.  A NULL check is added to prevent a segfault that would occur even with the global pointers for those users who run mythbackend with --noautoexpire (when there is no AutoExpire object).  Finally, the m_pEncoders field (which was initialized to the value of the global tvList--which is also NULL at this point) was removed from MythXML since it was no longer used.

Thanks to Raymond Wagner for finding the segfault.

More information about the mythtv-commits mailing list