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:
parent
99563bfde6
commit
44173808cb
@ -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 );
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user