mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-23 01:09:42 +01:00
* Added a safety check in PlaylistInterface to prevent infinite looping.
This commit is contained in:
parent
580b18c561
commit
23fb6aec56
@ -58,9 +58,13 @@ Tomahawk::result_ptr
|
||||
PlaylistInterface::siblingResult( int itemsAway ) const
|
||||
{
|
||||
qint64 idx = siblingIndex( itemsAway );
|
||||
qint64 safetyCheck = 0;
|
||||
|
||||
while ( idx >= 0 )
|
||||
// If safetyCheck equals idx, this means the interface keeps returning the same item and we won't discover anything new - abort
|
||||
// This can happen in repeat / random mode e.g.
|
||||
while ( idx >= 0 && safetyCheck != idx )
|
||||
{
|
||||
safetyCheck = idx;
|
||||
Tomahawk::query_ptr query = queryAt( idx );
|
||||
if ( query->numResults() )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user