mirror of
https://github.com/xerial/snappy-java.git
synced 2025-07-26 23:44:10 +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 uuid = UUID.randomUUID().toString();
|
||||||
String extractedLibFileName = String.format("snappy-%s-%s-%s", getVersion(), uuid, libraryFileName);
|
String extractedLibFileName = String.format("snappy-%s-%s-%s", getVersion(), uuid, libraryFileName);
|
||||||
File extractedLibFile = new File(targetFolder, extractedLibFileName);
|
File extractedLibFile = new File(targetFolder, extractedLibFileName);
|
||||||
// Delete extracted lib file on exit.
|
|
||||||
extractedLibFile.deleteOnExit();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Extract a native library file into the target directory
|
// Extract a native library file into the target directory
|
||||||
@ -220,6 +218,9 @@ public class SnappyLoader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
// Delete the extracted lib file on JVM exit.
|
||||||
|
extractedLibFile.deleteOnExit();
|
||||||
|
|
||||||
if(writer != null)
|
if(writer != null)
|
||||||
writer.close();
|
writer.close();
|
||||||
if(reader != null)
|
if(reader != null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user