hopefully make currentlyRunning more resilient
This commit is contained in:
parent
e705f9808b
commit
2e22f1cf54
@ -81,9 +81,19 @@ public abstract class AbstractNodeCostSearch implements IPathFinder {
|
|||||||
throw new IllegalStateException("Path Finder is currently in use, and cannot be reused!");
|
throw new IllegalStateException("Path Finder is currently in use, and cannot be reused!");
|
||||||
}
|
}
|
||||||
this.cancelRequested = false;
|
this.cancelRequested = false;
|
||||||
Optional<IPath> path = calculate0();
|
try {
|
||||||
isFinished = true;
|
Optional<IPath> path = calculate0();
|
||||||
return path;
|
isFinished = true;
|
||||||
|
return path;
|
||||||
|
} catch (Exception e) {
|
||||||
|
currentlyRunning = null;
|
||||||
|
isFinished = true;
|
||||||
|
if (e instanceof RuntimeException) {
|
||||||
|
throw (RuntimeException) e;
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract Optional<IPath> calculate0();
|
protected abstract Optional<IPath> calculate0();
|
||||||
|
Loading…
Reference in New Issue
Block a user