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 found two other
instances of this error.
  • Loading branch information...
1 parent c3eaf78 commit c7a1e812dce42615fd01686dcb172e964bace606 @daniel-kristjansson daniel-kristjansson committed Mar 30, 2012
@@ -519,6 +519,8 @@ MythMainWindow::MythMainWindow(const bool useDB)
MythMainWindow::~MythMainWindow()
{
+ gCoreContext->removeListener(this);
+
d->drawTimer->stop();
while (!d->stackList.isEmpty())
@@ -295,6 +295,8 @@ void MainServer::Stop()
{
m_stopped = true;
+ gCoreContext->removeListener(this);
+
{
QMutexLocker locker(&masterFreeSpaceListLock);
if (masterFreeSpaceListUpdater)
@@ -221,6 +221,8 @@ NetworkControl::NetworkControl() :
NetworkControl::~NetworkControl(void)
{
+ gCoreContext->removeListener(this);
+
clientLock.lock();
while (!clients.isEmpty())
{

0 comments on commit c7a1e81

Please sign in to comment.