Always reset the maps render state if purging started

This commit is contained in:
Blue (Lukas Rieger) 2021-05-11 00:44:42 +02:00
parent 00d7d3e397
commit f4926fe72d
No known key found for this signature in database
GPG Key ID: 904C4995F9E1F800

View File

@ -68,6 +68,7 @@ public void doWork() throws Exception {
this.hasMoreWork = false; this.hasMoreWork = false;
} }
try {
// delete subFiles first to be able to track the progress and cancel // delete subFiles first to be able to track the progress and cancel
while (!subFiles.isEmpty()) { while (!subFiles.isEmpty()) {
Path subFile = subFiles.getLast(); Path subFile = subFiles.getLast();
@ -78,12 +79,13 @@ public void doWork() throws Exception {
// make sure everything is deleted // make sure everything is deleted
FileUtils.delete(directory.toFile()); FileUtils.delete(directory.toFile());
} finally {
// reset map render state // reset map render state
if (this.map != null) { if (this.map != null) {
this.map.getRenderState().reset(); this.map.getRenderState().reset();
} }
} }
}
@Override @Override
public boolean hasMoreWork() { public boolean hasMoreWork() {