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 found two other
instances of this error.
  • Loading branch information
daniel-kristjansson committed Mar 30, 2012
1 parent c3eaf78 commit c7a1e81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mythtv/libs/libmythui/mythmainwindow.cpp
Expand Up @@ -519,6 +519,8 @@ MythMainWindow::MythMainWindow(const bool useDB)

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

d->drawTimer->stop();

while (!d->stackList.isEmpty())
Expand Down
2 changes: 2 additions & 0 deletions mythtv/programs/mythbackend/mainserver.cpp
Expand Up @@ -295,6 +295,8 @@ void MainServer::Stop()
{
m_stopped = true;

gCoreContext->removeListener(this);

{
QMutexLocker locker(&masterFreeSpaceListLock);
if (masterFreeSpaceListUpdater)
Expand Down
2 changes: 2 additions & 0 deletions mythtv/programs/mythfrontend/networkcontrol.cpp
Expand Up @@ -221,6 +221,8 @@ NetworkControl::NetworkControl() :

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

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

0 comments on commit c7a1e81

Please sign in to comment.