Merge branch 'stable-6.4' into stable-6.5

* stable-6.4:
  GC: Close File.lines stream

Change-Id: I7e3a4b3671e779fd62062c4e10d224f432e39b54
This commit is contained in:
Matthias Sohn 2023-03-23 09:07:33 +01:00
commit 67fcf76b4b
1 changed files with 3 additions and 2 deletions

View File

@ -1792,8 +1792,9 @@ private void failedToLock() {
private void gcAlreadyRunning() {
close();
try {
Optional<String> s = Files.lines(pidFile).findFirst();
Optional<String> s;
try (Stream<String> lines = Files.lines(pidFile)) {
s = lines.findFirst();
String machine = null;
String pid = null;
if (s.isPresent()) {