1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-22 16:59:58 +01:00

Hopefully fix startup crash in single-threaded infosystemworker mode

This commit is contained in:
Jeff Mitchell 2011-05-03 12:36:23 -04:00
parent 99563bfde6
commit 44173808cb
2 changed files with 9 additions and 4 deletions

View File

@ -62,7 +62,7 @@ InfoSystem::InfoSystem(QObject *parent)
m_infoSystemWorkerThreadController = new QThread( this );
m_worker = new InfoSystemWorker();
m_worker->moveToThread( m_infoSystemWorkerThreadController );
//m_worker->moveToThread( m_infoSystemWorkerThreadController );
m_infoSystemWorkerThreadController->start();
QMetaObject::invokeMethod( m_worker, "init", Qt::QueuedConnection );

View File

@ -169,6 +169,13 @@ InfoSystemWorker::newNam()
{
qDebug() << Q_FUNC_INFO;
QNetworkAccessManager *oldNam = TomahawkUtils::nam();
if ( oldNam && m_nam == oldNam )
{
emit namChanged();
return;
}
QNetworkAccessManager* newNam;
#ifdef LIBLASTFM_FOUND
newNam = new lastfm::NetworkAccessManager( this );
@ -176,10 +183,8 @@ InfoSystemWorker::newNam()
newNam = new QNetworkAccessManager( this );
#endif
if ( m_nam )
{
delete m_nam;
}
QNetworkAccessManager *oldNam = TomahawkUtils::nam();
if ( !oldNam )
{
m_nam = newNam;