Catch all progress tracker errors

This commit is contained in:
Jesse Boyd 2016-09-26 13:52:25 +10:00
parent f8a606c783
commit 9e6c90430d
3 changed files with 15 additions and 3 deletions

View File

@ -26,7 +26,11 @@ public class DefaultFaweQueueMap implements IFaweQueueMap {
@Override @Override
public FaweChunk put(Long key, FaweChunk value) { public FaweChunk put(Long key, FaweChunk value) {
if (parent.getProgressTask() != null) { if (parent.getProgressTask() != null) {
parent.getProgressTask().run(FaweQueue.ProgressType.QUEUE, size() + 1); try {
parent.getProgressTask().run(FaweQueue.ProgressType.QUEUE, size() + 1);
} catch (Throwable e) {
e.printStackTrace();
}
} }
return super.put(key, value); return super.put(key, value);
} }

View File

@ -205,7 +205,11 @@ public abstract class MappedFaweQueue<WORLD, CHUNK, SECTION> extends FaweQueue {
public void runTasks() { public void runTasks() {
super.runTasks(); super.runTasks();
if (getProgressTask() != null) { if (getProgressTask() != null) {
getProgressTask().run(ProgressType.DONE, 1); try {
getProgressTask().run(ProgressType.DONE, 1);
} catch (Throwable e) {
e.printStackTrace();
}
} }
ArrayDeque<Runnable> tmp = new ArrayDeque<>(tasks); ArrayDeque<Runnable> tmp = new ArrayDeque<>(tasks);
tasks.clear(); tasks.clear();

View File

@ -397,7 +397,11 @@ public abstract class FaweQueue {
this.notifyAll(); this.notifyAll();
} }
if (getProgressTask() != null) { if (getProgressTask() != null) {
getProgressTask().run(ProgressType.DONE, 1); try {
getProgressTask().run(ProgressType.DONE, 1);
} catch (Throwable e) {
e.printStackTrace();
}
} }
while (!tasks.isEmpty()) { while (!tasks.isEmpty()) {
Runnable task = tasks.poll(); Runnable task = tasks.poll();