summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Thor Kristjansson <danielk@cuymedia.net>2012-03-30 15:16:27 (GMT)
committer Daniel Thor Kristjansson <danielk@cuymedia.net>2012-03-30 15:16:37 (GMT)
commitc7a1e812dce42615fd01686dcb172e964bace606 (patch)
tree592b7e4ee2415e2af18bacb340cc9a17e264f1db
parentc3eaf781ca5cb6e95069063b77bee0e6a5e66de6 (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 found two other instances of this error.
-rw-r--r--mythtv/libs/libmythui/mythmainwindow.cpp2
-rw-r--r--mythtv/programs/mythbackend/mainserver.cpp2
-rw-r--r--mythtv/programs/mythfrontend/networkcontrol.cpp2
3 files changed, 6 insertions, 0 deletions
diff --git a/mythtv/libs/libmythui/mythmainwindow.cpp b/mythtv/libs/libmythui/mythmainwindow.cpp
index a8f3501..219d932 100644
--- a/mythtv/libs/libmythui/mythmainwindow.cpp
+++ b/mythtv/libs/libmythui/mythmainwindow.cpp
@@ -519,6 +519,8 @@ MythMainWindow::MythMainWindow(const bool useDB)
MythMainWindow::~MythMainWindow()
{
+ gCoreContext->removeListener(this);
+
d->drawTimer->stop();
while (!d->stackList.isEmpty())
diff --git a/mythtv/programs/mythbackend/mainserver.cpp b/mythtv/programs/mythbackend/mainserver.cpp
index 7f16ce4..ff002b4 100644
--- a/mythtv/programs/mythbackend/mainserver.cpp
+++ b/mythtv/programs/mythbackend/mainserver.cpp
@@ -295,6 +295,8 @@ void MainServer::Stop()
{
m_stopped = true;
+ gCoreContext->removeListener(this);
+
{
QMutexLocker locker(&masterFreeSpaceListLock);
if (masterFreeSpaceListUpdater)
diff --git a/mythtv/programs/mythfrontend/networkcontrol.cpp b/mythtv/programs/mythfrontend/networkcontrol.cpp
index 0e056cf..eaf09bc 100644
--- a/mythtv/programs/mythfrontend/networkcontrol.cpp
+++ b/mythtv/programs/mythfrontend/networkcontrol.cpp
@@ -221,6 +221,8 @@ NetworkControl::NetworkControl() :
NetworkControl::~NetworkControl(void)
{
+ gCoreContext->removeListener(this);
+
clientLock.lock();
while (!clients.isEmpty())
{