summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Thor Kristjansson <danielk@cuymedia.net>2012-03-30 15:16:27 (GMT)
committer Stuart Morgan <smorgan@mythtv.org>2012-04-08 20:44:32 (GMT)
commit08dffd40a052cb65fa8e5a7f46232ec96ea998aa (patch)
treeddae57b0a33ef52413bc00fa93fb46dd3e4bcb43
parent91a06b908bad75ad222117477fee9b270182378c (diff)
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 c7a1e812dce42615fd01686dcb172e964bace606) Refs #10359
-rw-r--r--mythtv/libs/libmythui/mythmainwindow.cpp2
-rw-r--r--mythtv/programs/mythfrontend/networkcontrol.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/mythtv/libs/libmythui/mythmainwindow.cpp b/mythtv/libs/libmythui/mythmainwindow.cpp
index 121f4c2..9b19232 100644
--- a/mythtv/libs/libmythui/mythmainwindow.cpp
+++ b/mythtv/libs/libmythui/mythmainwindow.cpp
@@ -476,6 +476,8 @@ MythMainWindow::MythMainWindow(const bool useDB)
MythMainWindow::~MythMainWindow()
{
+ gCoreContext->removeListener(this);
+
d->drawTimer->stop();
while (!d->stackList.isEmpty())
diff --git a/mythtv/programs/mythfrontend/networkcontrol.cpp b/mythtv/programs/mythfrontend/networkcontrol.cpp
index 211a85a..d9f9141 100644
--- a/mythtv/programs/mythfrontend/networkcontrol.cpp
+++ b/mythtv/programs/mythfrontend/networkcontrol.cpp
@@ -225,6 +225,8 @@ NetworkControl::NetworkControl() :
NetworkControl::~NetworkControl(void)
{
+ gCoreContext->removeListener(this);
+
clientLock.lock();
while (!clients.isEmpty())
{