Skip to content

Commit

Permalink
Remove temp files on exit. Fixes #36 (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsideup authored Jul 19, 2019
1 parent cbc01d7 commit 88b1e94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions agent/src/main/java/reactor/blockhound/BlockHound.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ private static Path extractNativeLibFile() throws IOException {
}

Path tempFile = Files.createTempFile("BlockHound", ".dylib");
tempFile.toFile().deleteOnExit();
try (InputStream inputStream = nativeLibraryURL.openStream()) {
Files.copy(inputStream, tempFile, StandardCopyOption.REPLACE_EXISTING);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class InstrumentationUtils {

static void injectBootstrapClasses(Instrumentation instrumentation, String... classNames) throws IOException {
File tempJarFile = File.createTempFile("BlockHound", ".jar");
tempJarFile.deleteOnExit();

ClassLoader classLoader = BlockHound.class.getClassLoader();
try (ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(tempJarFile))) {
Expand Down

0 comments on commit 88b1e94

Please sign in to comment.