mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
try harder to close files ignoring exceptions
This commit is contained in:
@@ -202,7 +202,7 @@ public class MapReduceIndex<Key, Value, Input> implements UpdatableIndex<Key,Val
|
||||
try {
|
||||
index.close();
|
||||
}
|
||||
catch (IOException ignored) {
|
||||
catch (Throwable ignored) {
|
||||
}
|
||||
|
||||
IOUtil.deleteAllFilesStartingWith(baseFile);
|
||||
|
||||
@@ -505,16 +505,19 @@ public class PersistentHashMapValueStorage {
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
if (myCompressedAppendableFile != null) myCompressedAppendableFile.dispose();
|
||||
if (mySize < 0) assert false; // volatile read
|
||||
ourReadersCache.remove(myPath);
|
||||
ourAppendersCache.remove(myPath);
|
||||
try {
|
||||
if (myCompressedAppendableFile != null) myCompressedAppendableFile.dispose();
|
||||
} finally {
|
||||
if (mySize < 0) assert false; // volatile read
|
||||
ourReadersCache.remove(myPath);
|
||||
ourAppendersCache.remove(myPath);
|
||||
|
||||
ourRandomAccessFileCache.remove(myPath);
|
||||
ourRandomAccessFileCache.remove(myPath);
|
||||
|
||||
if (myCompactionModeReader != null) {
|
||||
myCompactionModeReader.dispose();
|
||||
myCompactionModeReader = null;
|
||||
if (myCompactionModeReader != null) {
|
||||
myCompactionModeReader.dispose();
|
||||
myCompactionModeReader = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user