Fixed memory leak when using Export

Also fixes an issue where players with partially same name get wrong json URL
This commit is contained in:
Rsl1122 2020-01-17 20:34:09 +02:00
parent f16bd6a565
commit 0cfd98a127
5 changed files with 9 additions and 0 deletions

View File

@ -44,4 +44,9 @@ public class ExportPaths {
this.replace.add(replace);
this.with.add(with);
}
public void clear() {
this.replace.clear();
this.with.clear();
}
}

View File

@ -84,6 +84,7 @@ public class NetworkPageExporter extends FileExporter {
exportRequiredResources(toDirectory);
exportJSON(toDirectory, server);
exportHtml(toDirectory);
exportPaths.clear();
}
private void exportHtml(Path toDirectory) throws IOException, GenerationException {

View File

@ -89,6 +89,7 @@ public class PlayerPageExporter extends FileExporter {
Path playerDirectory = toDirectory.resolve("player/" + toFileName(playerName));
exportJSON(playerDirectory, playerUUID, playerName);
exportHtml(playerDirectory, playerUUID);
exportPaths.clear();
}
private void exportHtml(Path playerDirectory, UUID playerUUID) throws IOException, GenerationException, NotFoundException {

View File

@ -87,6 +87,7 @@ public class PlayersPageExporter extends FileExporter {
exportRequiredResources(toDirectory);
exportJSON(toDirectory);
exportHtml(toDirectory);
exportPaths.clear();
}
private void exportHtml(Path toDirectory) throws IOException, GenerationException {

View File

@ -89,6 +89,7 @@ public class ServerPageExporter extends FileExporter {
exportRequiredResources(toDirectory);
exportJSON(toDirectory, server);
exportHtml(toDirectory, server);
exportPaths.clear();
}
private void exportHtml(Path toDirectory, Server server) throws IOException, NotFoundException, GenerationException {