mirror of
https://github.com/xerial/snappy-java.git
synced 2025-07-23 14:04:39 +02:00
Fixes #46. Set deleteOnExit() after creating the library file
This commit is contained in:
parent
b1e1c00733
commit
ee94db9840
@ -205,8 +205,6 @@ public class SnappyLoader
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
String extractedLibFileName = String.format("snappy-%s-%s-%s", getVersion(), uuid, libraryFileName);
|
||||
File extractedLibFile = new File(targetFolder, extractedLibFileName);
|
||||
// Delete extracted lib file on exit.
|
||||
extractedLibFile.deleteOnExit();
|
||||
|
||||
try {
|
||||
// Extract a native library file into the target directory
|
||||
@ -220,6 +218,9 @@ public class SnappyLoader
|
||||
}
|
||||
}
|
||||
finally {
|
||||
// Delete the extracted lib file on JVM exit.
|
||||
extractedLibFile.deleteOnExit();
|
||||
|
||||
if(writer != null)
|
||||
writer.close();
|
||||
if(reader != null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user