From 56e9e6a245212fabce689f7750b0f77d4ed2d0ad Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 12 Feb 2014 19:53:33 +1100 Subject: [PATCH] Delete extracted native code on exit --- native/src/main/java/net/md_5/bungee/NativeCipher.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/native/src/main/java/net/md_5/bungee/NativeCipher.java b/native/src/main/java/net/md_5/bungee/NativeCipher.java index 6d4c42c3..3dc6920a 100644 --- a/native/src/main/java/net/md_5/bungee/NativeCipher.java +++ b/native/src/main/java/net/md_5/bungee/NativeCipher.java @@ -37,6 +37,8 @@ public class NativeCipher implements BungeeCipher { // Else we will create and copy it to a temp file File temp = File.createTempFile( "bungeecord-native-cipher", ".so" ); + temp.deleteOnExit(); + try ( OutputStream outputStream = new FileOutputStream( temp ) ) { ByteStreams.copy( lib, outputStream );