Close empty cursors for SongTimeline.addSongs

This commit is contained in:
Christopher Eby 2011-11-05 23:11:39 -05:00
parent 16d8f56764
commit 2569247cbf
2 changed files with 7 additions and 3 deletions

View File

@ -1149,7 +1149,13 @@ public final class PlaybackService extends Service
*/
public void runQuery(int mode, QueryTask query, int jumpTo)
{
int count = mTimeline.addSongs(mode, query.runQuery(getContentResolver()), jumpTo, query.getExtra());
Cursor cursor = query.runQuery(getContentResolver());
if (cursor == null) {
return;
}
int count = mTimeline.addSongs(mode, cursor, jumpTo, query.getExtra());
cursor.close();
int text;

View File

@ -614,8 +614,6 @@ public final class SongTimeline {
broadcastChangedSongs();
}
cursor.close();
changed();
return count;