Skip to content

Commit

Permalink
Move the setting of the parent of the cookiejar to the download manag…
Browse files Browse the repository at this point in the history
…er thread.

This fixes a possible abort in some Qt builds/setups with trying to set the parent
of the cookiesjar in a thread that didn't create it. Refs #9802.
  • Loading branch information
Paul Harrison committed May 25, 2011
1 parent fb6d707 commit e8e1775
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mythtv/libs/libmythbase/mythdownloadmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <QFile>
#include <QDir>
#include <QThreadPool>
#include <QNetworkCookieJar>

#include "stdlib.h"

Expand Down Expand Up @@ -200,7 +201,8 @@ void MythDownloadManager::run(void)
m_manager->setCache(m_diskCache);

// make sure the cookieJar is created in the same thread as the manager
m_manager->cookieJar();
// and set its parent to NULL so it can be shared between managers
m_manager->cookieJar()->setParent(NULL);

QObject::connect(m_manager, SIGNAL(finished(QNetworkReply*)), this,
SLOT(downloadFinished(QNetworkReply*)));
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythui/mythuiwebbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ static QNetworkAccessManager *GetNetworkAccessManager(void)

networkManager = new QNetworkAccessManager();
networkManager->setCookieJar(GetMythDownloadManager()->getCookieJar());
networkManager->cookieJar()->setParent(NULL);

atexit(DestroyNetworkAccessManager);

Expand Down

0 comments on commit e8e1775

Please sign in to comment.