[mythtv-commits] [MythTV/mythtv] a2cf26: Check instance before starting EnableUDPListener

kmdewaal noreply at github.com
Tue Jun 22 17:16:38 UTC 2021

  Branch: refs/heads/master
  Home:   https://github.com/MythTV/mythtv
  Commit: a2cf263313e3db744cae4507f175982fbe26e8da
  Author: Klaas de Waal <kdewaal at mythtv.org>
  Date:   2021-06-22 (Tue, 22 Jun 2021)

  Changed paths:
    M mythtv/libs/libmythui/mythudplistener.cpp

  Log Message:
  Check instance before starting EnableUDPListener

When the database setting StartupScreenDelay is changed from 0 to another value
outside of mythfrontend, e.g. with manual sql commands or by switching to a restored
database, mythtv-setup and mythfrontend do crash after briefly showing the setup screen.
This is now fixed by checking both the thread and the instance pointer before
calling EnableUDPListener. If the check fails an error message is given.
As to why this happens, this is the bit of code around mythcontext.cpp:1652:
    if (d->m_settingsCacheDirty)
        d->m_settingsCacheDirty = false;
This bit of code is called when the setup screen is pulled down and before
the real main winow is created.
The DestroyMythMainWindow does delete the MythUDPListener instance.
The MythUDPListener is static which means it is never created again, causing
the creation of the real main window to fail when the UPDListener is started.

More information about the mythtv-commits mailing list