mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-15 10:33:59 +02:00
* Fixed shutdown freezes.
This commit is contained in:
@@ -86,59 +86,28 @@ InfoSystem::~InfoSystem()
|
|||||||
|
|
||||||
if ( !m_worker.isNull() )
|
if ( !m_worker.isNull() )
|
||||||
{
|
{
|
||||||
QMetaObject::invokeMethod( m_worker.data(), "deleteLater", Qt::QueuedConnection );
|
|
||||||
while( !m_worker.isNull() )
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO << " worker not deleted";
|
|
||||||
TomahawkUtils::Sleep::msleep( 50 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_infoSystemWorkerThreadController )
|
|
||||||
m_infoSystemWorkerThreadController->quit();
|
|
||||||
|
|
||||||
if( m_infoSystemWorkerThreadController )
|
if( m_infoSystemWorkerThreadController )
|
||||||
{
|
{
|
||||||
while( !m_infoSystemWorkerThreadController->isFinished() )
|
m_worker.clear();
|
||||||
{
|
m_infoSystemWorkerThreadController->quit();
|
||||||
qDebug() << Q_FUNC_INFO << " worker thread controller not finished";
|
m_infoSystemWorkerThreadController->wait( 60000 );
|
||||||
TomahawkUtils::Sleep::msleep( 50 );
|
|
||||||
}
|
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << " worker thread controller finished, deleting worker";
|
|
||||||
delete m_infoSystemWorkerThreadController;
|
delete m_infoSystemWorkerThreadController;
|
||||||
|
qDebug() << Q_FUNC_INFO << " worker thread controller finished, deleting worker";
|
||||||
m_infoSystemWorkerThreadController = 0;
|
m_infoSystemWorkerThreadController = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << " done deleting worker";
|
qDebug() << Q_FUNC_INFO << " done deleting worker";
|
||||||
|
|
||||||
if ( !m_cache.isNull() )
|
|
||||||
{
|
|
||||||
QMetaObject::invokeMethod( m_cache.data(), "deleteLater", Qt::QueuedConnection );
|
|
||||||
while( !m_cache.isNull() )
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO << " cache not deleted";
|
|
||||||
TomahawkUtils::Sleep::msleep( 50 );
|
|
||||||
}
|
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << " cache deleted, telling cache thread controller to quit";
|
|
||||||
|
|
||||||
if ( m_infoSystemCacheThreadController )
|
|
||||||
m_infoSystemCacheThreadController->quit();
|
|
||||||
|
|
||||||
if( m_infoSystemCacheThreadController )
|
if( m_infoSystemCacheThreadController )
|
||||||
{
|
{
|
||||||
while( !m_infoSystemCacheThreadController->isFinished() )
|
m_cache.clear();
|
||||||
{
|
m_infoSystemCacheThreadController->quit();
|
||||||
qDebug() << Q_FUNC_INFO << " cache thread controller not finished";
|
m_infoSystemCacheThreadController->wait( 60000 );
|
||||||
TomahawkUtils::Sleep::msleep( 50 );
|
|
||||||
}
|
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << " cache thread controller finished, deleting cache";
|
|
||||||
delete m_infoSystemCacheThreadController;
|
delete m_infoSystemCacheThreadController;
|
||||||
|
qDebug() << Q_FUNC_INFO << " cache thread controller finished, deleting cache";
|
||||||
m_infoSystemCacheThreadController = 0;
|
m_infoSystemCacheThreadController = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << " done deleting cache, exiting";
|
qDebug() << Q_FUNC_INFO << " done deleting cache, exiting";
|
||||||
}
|
}
|
||||||
|
@@ -49,6 +49,7 @@ InfoSystemWorker::~InfoSystemWorker()
|
|||||||
if( plugin )
|
if( plugin )
|
||||||
delete plugin.data();
|
delete plugin.data();
|
||||||
}
|
}
|
||||||
|
qDebug() << Q_FUNC_INFO << " finished";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user