1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-24 01:39:42 +01:00

Fix crash in jreen and others by not processing events in infosystem's destructor. Instead, sleep for only 50ms at a time.

This commit is contained in:
Jeff Mitchell 2011-05-12 10:38:16 -04:00
parent 04cbc78ff7
commit d0ccbf4416

View File

@ -90,8 +90,7 @@ InfoSystem::~InfoSystem()
while( !m_worker.isNull() )
{
qDebug() << Q_FUNC_INFO << " worker not deleted, processing events";
QCoreApplication::processEvents( QEventLoop::AllEvents, 200 );
TomahawkUtils::Sleep::msleep( 100 );
TomahawkUtils::Sleep::msleep( 50 );
}
if ( m_infoSystemWorkerThreadController )
@ -102,8 +101,7 @@ InfoSystem::~InfoSystem()
while( !m_infoSystemWorkerThreadController->isFinished() )
{
qDebug() << Q_FUNC_INFO << " worker thread controller not finished, processing events";
QCoreApplication::processEvents( QEventLoop::AllEvents, 200 );
TomahawkUtils::Sleep::msleep( 100 );
TomahawkUtils::Sleep::msleep( 50 );
}
delete m_infoSystemWorkerThreadController;
@ -119,8 +117,7 @@ InfoSystem::~InfoSystem()
while( !m_cache.isNull() )
{
qDebug() << Q_FUNC_INFO << " worker not deleted, processing events";
QCoreApplication::processEvents( QEventLoop::AllEvents, 200 );
TomahawkUtils::Sleep::msleep( 100 );
TomahawkUtils::Sleep::msleep( 50 );
}
if ( m_infoSystemCacheThreadController )
@ -131,8 +128,7 @@ InfoSystem::~InfoSystem()
while( !m_infoSystemCacheThreadController->isFinished() )
{
qDebug() << Q_FUNC_INFO << " worker thread controller not finished, processing events";
QCoreApplication::processEvents( QEventLoop::AllEvents, 200 );
TomahawkUtils::Sleep::msleep( 100 );
TomahawkUtils::Sleep::msleep( 50 );
}
delete m_infoSystemCacheThreadController;