mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-15 02:24:50 +02:00
Emit signal when shutdown gets blocked by outstanding db jobs.
This commit is contained in:
@@ -155,16 +155,17 @@ Database::~Database()
|
|||||||
workerThread->quit();
|
workerThread->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emit waitingForWorkers();
|
||||||
if ( m_workerRW )
|
if ( m_workerRW )
|
||||||
{
|
{
|
||||||
m_workerRW.data()->wait( 60000 );
|
m_workerRW.data()->wait();
|
||||||
delete m_workerRW.data();
|
delete m_workerRW.data();
|
||||||
}
|
}
|
||||||
foreach ( QPointer< DatabaseWorkerThread > workerThread, m_workerThreads )
|
foreach ( QPointer< DatabaseWorkerThread > workerThread, m_workerThreads )
|
||||||
{
|
{
|
||||||
if ( workerThread )
|
if ( workerThread )
|
||||||
{
|
{
|
||||||
workerThread.data()->wait( 60000 );
|
workerThread.data()->wait();
|
||||||
delete workerThread.data();
|
delete workerThread.data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,6 +175,7 @@ Database::~Database()
|
|||||||
qDeleteAll( m_commandFactories.values() );
|
qDeleteAll( m_commandFactories.values() );
|
||||||
delete m_impl;
|
delete m_impl;
|
||||||
|
|
||||||
|
emit workersFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -108,6 +108,9 @@ signals:
|
|||||||
void newJobRO( Tomahawk::dbcmd_ptr );
|
void newJobRO( Tomahawk::dbcmd_ptr );
|
||||||
void newJobRW( Tomahawk::dbcmd_ptr );
|
void newJobRW( Tomahawk::dbcmd_ptr );
|
||||||
|
|
||||||
|
void waitingForWorkers();
|
||||||
|
void workersFinished();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void enqueue( const Tomahawk::dbcmd_ptr& lc );
|
void enqueue( const Tomahawk::dbcmd_ptr& lc );
|
||||||
void enqueue( const QList< Tomahawk::dbcmd_ptr >& lc );
|
void enqueue( const QList< Tomahawk::dbcmd_ptr >& lc );
|
||||||
|
Reference in New Issue
Block a user