Permalink
Browse files

Fixes segfault on mythfrontend exit & related problems.

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...
1 parent 91a06b9 commit 08dffd40a052cb65fa8e5a7f46232ec96ea998aa @daniel-kristjansson daniel-kristjansson committed with stuartm Mar 30, 2012
Showing with 4 additions and 0 deletions.
  1. +2 −0 mythtv/libs/libmythui/mythmainwindow.cpp
  2. +2 −0 mythtv/programs/mythfrontend/networkcontrol.cpp
@@ -476,6 +476,8 @@ MythMainWindow::MythMainWindow(const bool useDB)
MythMainWindow::~MythMainWindow()
{
+ gCoreContext->removeListener(this);
+
d->drawTimer->stop();
while (!d->stackList.isEmpty())
@@ -225,6 +225,8 @@ NetworkControl::NetworkControl() :
NetworkControl::~NetworkControl(void)
{
+ gCoreContext->removeListener(this);
+
clientLock.lock();
while (!clients.isEmpty())
{

0 comments on commit 08dffd4

Please sign in to comment.