mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
Catch boost::unitialized_future if it is thrown
This commit is contained in:
@@ -163,6 +163,8 @@ Album::id() const
|
||||
s_idMutex.unlock();
|
||||
|
||||
if ( waiting )
|
||||
{
|
||||
try
|
||||
{
|
||||
finalId = m_idFuture.get();
|
||||
|
||||
@@ -174,6 +176,12 @@ Album::id() const
|
||||
s_albumsById[ m_id ] = m_ownRef.toStrongRef();
|
||||
s_idMutex.unlock();
|
||||
}
|
||||
catch( boost::future_uninitialized& e )
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
return finalId;
|
||||
}
|
||||
|
@@ -243,6 +243,8 @@ Artist::id() const
|
||||
s_idMutex.unlock();
|
||||
|
||||
if ( waiting )
|
||||
{
|
||||
try
|
||||
{
|
||||
finalid = m_idFuture.get();
|
||||
|
||||
@@ -254,6 +256,12 @@ Artist::id() const
|
||||
s_artistsById[ m_id ] = m_ownRef.toStrongRef();
|
||||
s_idMutex.unlock();
|
||||
}
|
||||
catch( boost::future_uninitialized& e )
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
return m_id;
|
||||
}
|
||||
|
Reference in New Issue
Block a user