mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Fixed InfoSystem DTOR freezing.
This commit is contained in:
@@ -86,55 +86,24 @@ InfoSystem::~InfoSystem()
|
|||||||
|
|
||||||
if ( !m_worker.isNull() )
|
if ( !m_worker.isNull() )
|
||||||
{
|
{
|
||||||
QMetaObject::invokeMethod( m_worker.data(), "deleteLater", Qt::QueuedConnection );
|
m_worker.clear();
|
||||||
while( !m_worker.isNull() )
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO << " worker not deleted, processing events";
|
|
||||||
TomahawkUtils::Sleep::msleep( 50 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_infoSystemWorkerThreadController )
|
|
||||||
m_infoSystemWorkerThreadController->quit();
|
m_infoSystemWorkerThreadController->quit();
|
||||||
|
m_infoSystemWorkerThreadController->wait( 60000 );
|
||||||
if( m_infoSystemWorkerThreadController )
|
|
||||||
{
|
|
||||||
while( !m_infoSystemWorkerThreadController->isFinished() )
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO << " worker thread controller not finished, processing events";
|
|
||||||
TomahawkUtils::Sleep::msleep( 50 );
|
|
||||||
}
|
|
||||||
|
|
||||||
delete m_infoSystemWorkerThreadController;
|
delete m_infoSystemWorkerThreadController;
|
||||||
m_infoSystemWorkerThreadController = 0;
|
m_infoSystemWorkerThreadController = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << " done deleting worker";
|
qDebug() << Q_FUNC_INFO << " done deleting worker";
|
||||||
|
|
||||||
if ( !m_cache.isNull() )
|
if ( !m_cache.isNull() )
|
||||||
{
|
{
|
||||||
QMetaObject::invokeMethod( m_cache.data(), "deleteLater", Qt::QueuedConnection );
|
m_cache.clear();
|
||||||
while( !m_cache.isNull() )
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO << " worker not deleted, processing events";
|
|
||||||
TomahawkUtils::Sleep::msleep( 50 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_infoSystemCacheThreadController )
|
|
||||||
m_infoSystemCacheThreadController->quit();
|
m_infoSystemCacheThreadController->quit();
|
||||||
|
m_infoSystemCacheThreadController->wait( 60000 );
|
||||||
if( m_infoSystemCacheThreadController )
|
|
||||||
{
|
|
||||||
while( !m_infoSystemCacheThreadController->isFinished() )
|
|
||||||
{
|
|
||||||
qDebug() << Q_FUNC_INFO << " worker thread controller not finished, processing events";
|
|
||||||
TomahawkUtils::Sleep::msleep( 50 );
|
|
||||||
}
|
|
||||||
|
|
||||||
delete m_infoSystemCacheThreadController;
|
delete m_infoSystemCacheThreadController;
|
||||||
m_infoSystemCacheThreadController = 0;
|
m_infoSystemCacheThreadController = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << " done deleting cache";
|
qDebug() << Q_FUNC_INFO << " done deleting cache";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user