mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-02 04:10:20 +02:00
Catch by const ref and assert to check hypothesis
This commit is contained in:
@@ -176,10 +176,12 @@ Album::id() const
|
|||||||
s_albumsById[ m_id ] = m_ownRef.toStrongRef();
|
s_albumsById[ m_id ] = m_ownRef.toStrongRef();
|
||||||
s_idMutex.unlock();
|
s_idMutex.unlock();
|
||||||
}
|
}
|
||||||
catch( boost::future_uninitialized& e )
|
catch( const boost::future_uninitialized& e )
|
||||||
{
|
{
|
||||||
qWarning() << "Caught boost::future_uninitialized when trying to get artist id from future, WTF?";
|
qWarning() << "Caught boost::future_uninitialized when trying to get artist id from future, WTF?";
|
||||||
qWarning() << "Potential race condition, do we have an ID?" << m_id << "and waiting?" << m_waitingForId << e.what();
|
qWarning() << "Potential race condition, do we have an ID?" << m_id << "and waiting?" << m_waitingForId << e.what();
|
||||||
|
|
||||||
|
Q_ASSERT( !m_waitingForId );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -256,10 +256,12 @@ Artist::id() const
|
|||||||
s_artistsById[ m_id ] = m_ownRef.toStrongRef();
|
s_artistsById[ m_id ] = m_ownRef.toStrongRef();
|
||||||
s_idMutex.unlock();
|
s_idMutex.unlock();
|
||||||
}
|
}
|
||||||
catch( boost::future_uninitialized& e )
|
catch( const boost::future_uninitialized& e )
|
||||||
{
|
{
|
||||||
qWarning() << "Caught boost::future_uninitialized when trying to get artist id from future, WTF?";
|
qWarning() << "Caught boost::future_uninitialized when trying to get artist id from future, WTF?";
|
||||||
qWarning() << "Potential race condition, do we have an ID?" << m_id << "and waiting?" << m_waitingForFuture << e.what();
|
qWarning() << "Potential race condition, do we have an ID?" << m_id << "and waiting?" << m_waitingForFuture << e.what();
|
||||||
|
|
||||||
|
Q_ASSERT( !m_waitingForFuture );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user