Commit 12d15858 authored by Adrien Maglo's avatar Adrien Maglo
Browse files

Android thumbnailer: prevent the thumbnailer from crashing

when all the thumbnails of the current directory have been generated and a file is selected for playback.
parent 8aa14f39
......@@ -57,12 +57,19 @@ public class ThumbnailerManager extends Thread {
while (!isInterrupted()) {
lock.lock();
// Get the id of the file browser item to create its thumbnail.
boolean killed = false;
while (mIds.size() == 0)
{
try {
notEmpty.await();
} catch (InterruptedException e) {
killed = true;
break;
}
}
}
if (killed)
break;
int id = mIds.getFirst();
mIds.removeFirst();
lock.unlock();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment