Skip to content

Commit

Permalink
Fixes segfault on mythfrontend exit & related problems.
Browse files Browse the repository at this point in the history
NetworkControl wasn't removing itself from the listener list when the object was
deleted causing a segfault when an event was received during shutdown.

Reviewed other instances of gCoreContext->addListener() and fixed one other
instances of this error.
(cherry picked from commit c7a1e81)

Refs #10359
  • Loading branch information
daniel-kristjansson authored and stuartm committed Apr 8, 2012
1 parent 91a06b9 commit 08dffd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mythtv/libs/libmythui/mythmainwindow.cpp
Expand Up @@ -476,6 +476,8 @@ MythMainWindow::MythMainWindow(const bool useDB)


MythMainWindow::~MythMainWindow() MythMainWindow::~MythMainWindow()
{ {
gCoreContext->removeListener(this);

d->drawTimer->stop(); d->drawTimer->stop();


while (!d->stackList.isEmpty()) while (!d->stackList.isEmpty())
Expand Down
2 changes: 2 additions & 0 deletions mythtv/programs/mythfrontend/networkcontrol.cpp
Expand Up @@ -225,6 +225,8 @@ NetworkControl::NetworkControl() :


NetworkControl::~NetworkControl(void) NetworkControl::~NetworkControl(void)
{ {
gCoreContext->removeListener(this);

clientLock.lock(); clientLock.lock();
while (!clients.isEmpty()) while (!clients.isEmpty())
{ {
Expand Down

0 comments on commit 08dffd4

Please sign in to comment.