SteamWar/BauSystem2.0
Archiviert
12
0

Hotfix memory leak
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-10-03 21:38:05 +02:00
Ursprung 31f04ef07b
Commit 7c79b47d61
2 geänderte Dateien mit 12 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -53,6 +53,12 @@ public class StoredRecords {
}, 1, 1); }, 1, 1);
} }
static void cleanup(Player player) {
isolatedTNT.forEach((region, playerListMap) -> playerListMap.remove(player));
replayTime.forEach((region, playerIntegerMap) -> playerIntegerMap.remove(player));
replayLoops.forEach((region, playerIntegerMap) -> playerIntegerMap.remove(player));
}
public static void add(Region region, Record record) { public static void add(Region region, Record record) {
records.computeIfAbsent(region, k -> new ArrayList<>()).add(record); records.computeIfAbsent(region, k -> new ArrayList<>()).add(record);
} }

Datei anzeigen

@ -161,13 +161,12 @@ public class TraceShowManager implements Listener {
@EventHandler @EventHandler
public void onLeave(PlayerQuitEvent event) { public void onLeave(PlayerQuitEvent event) {
Region region = Region.getRegion(event.getPlayer().getLocation()); Region region = Region.getRegion(event.getPlayer().getLocation());
if (region.isGlobal()) { if (!region.isGlobal()) {
return; Map<Player, ShowMode<TNTPosition>> regionalShowModes = showModes.get(region);
if (regionalShowModes != null) {
regionalShowModes.remove(event.getPlayer());
}
} }
Map<Player, ShowMode<TNTPosition>> regionalShowModes = showModes.get(region); StoredRecords.cleanup(event.getPlayer());
if (regionalShowModes == null) {
return;
}
regionalShowModes.remove(event.getPlayer());
} }
} }