mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-17 17:21:53 +01:00
updated settings cleanup to prevent issue with the update process
Former-commit-id: 7b290d8aacb8f78c1064fd210b1e100da5cb86b8
This commit is contained in:
@@ -888,7 +888,7 @@ public class DependencyCheckScanAgent {
|
||||
"Unable to connect to the dependency-check database; analysis has stopped");
|
||||
LOGGER.log(Level.FINE, "", ex);
|
||||
} finally {
|
||||
Settings.cleanup();
|
||||
Settings.cleanup(true);
|
||||
if (engine != null) {
|
||||
engine.cleanup();
|
||||
}
|
||||
|
||||
@@ -247,9 +247,11 @@ public final class Settings {
|
||||
|
||||
/**
|
||||
* Cleans up resources to prevent memory leaks.
|
||||
*
|
||||
* @param deleteTemporary flag indicating whether any temporary directories generated should be removed
|
||||
*/
|
||||
public static void cleanup() {
|
||||
if (tempDirectory != null && tempDirectory.exists()) {
|
||||
public static void cleanup(boolean deleteTemporary) {
|
||||
if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) {
|
||||
FileUtils.delete(tempDirectory);
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -32,6 +32,6 @@ public class BaseTest {
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass() throws Exception {
|
||||
Settings.cleanup();
|
||||
Settings.cleanup(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user