mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-06 00:52:34 +02:00
Add some asserts to guarantee no access to Database before it's ready
This commit is contained in:
parent
45b10435df
commit
53f4569d11
@ -82,6 +82,7 @@ Database::loadIndex()
|
||||
void
|
||||
Database::enqueue( const QList< QSharedPointer<DatabaseCommand> >& lc )
|
||||
{
|
||||
Q_ASSERT( m_ready );
|
||||
qDebug() << "Enqueueing" << lc.count() << "commands to rw thread";
|
||||
m_workerRW->enqueue( lc );
|
||||
}
|
||||
@ -90,6 +91,7 @@ Database::enqueue( const QList< QSharedPointer<DatabaseCommand> >& lc )
|
||||
void
|
||||
Database::enqueue( const QSharedPointer<DatabaseCommand>& lc )
|
||||
{
|
||||
Q_ASSERT( m_ready );
|
||||
if ( lc->doesMutates() )
|
||||
{
|
||||
qDebug() << "Enqueueing command to rw thread:" << lc->commandname();
|
||||
@ -134,6 +136,7 @@ Database::enqueue( const QSharedPointer<DatabaseCommand>& lc )
|
||||
DatabaseImpl*
|
||||
Database::impl()
|
||||
{
|
||||
Q_ASSERT( m_ready );
|
||||
QMutexLocker lock( &m_mutex );
|
||||
|
||||
QThread* thread = QThread::currentThread();
|
||||
|
Loading…
x
Reference in New Issue
Block a user