8344903: Improve error handling TestJhsdbJstackPrintVMLocks.java

Reviewed-by: lmesnik, dholmes
This commit is contained in:
SendaoYan 2024-11-25 01:31:16 +00:00
parent a83cfe2658
commit 8f08020fa4

View File

@ -79,7 +79,10 @@ public class TestJhsdbJstackPrintVMLocks {
} }
throw new RuntimeException("Not able to find lock"); throw new RuntimeException("Not able to find lock");
} finally { } finally {
theApp.getProcess().destroyForcibly(); if (theApp.getProcess() != null) {
theApp.deleteLock();
theApp.getProcess().destroyForcibly();
}
} }
} }
} }