mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-16 16:15:06 +00:00
Fix file descriptor leak
This commit is contained in:
parent
818bb41091
commit
c6fa10de6e
@ -60,7 +60,7 @@ protected Reader prepareReader() {
|
||||
@Override
|
||||
protected void releaseReader(Reader reader) {
|
||||
try {
|
||||
prepareReader().close();
|
||||
reader.close();
|
||||
}
|
||||
catch (IOException e) {
|
||||
log.warn( "Unable to close file reader for generation script source" );
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
@ -56,7 +58,12 @@ public void setUp() throws Exception {
|
||||
public void tearDown() {
|
||||
serviceRegistry.close();
|
||||
if ( defaultImportFile.exists() ) {
|
||||
defaultImportFile.delete();
|
||||
try {
|
||||
Files.delete( defaultImportFile.toPath() );
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user