mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-11-29 08:55:48 +00:00
Ignore closed channel exception when closing the channel lock
This commit is contained in:
1 parent
a83924238f
commit
4177deccf1
1 file changed
+5
-1
@@ -38,6 +38,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.ClosedChannelException;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.FileLock;
|
||||
import java.util.Collection;
|
||||
@@ -429,7 +430,10 @@ public class SignalAccount implements Closeable {
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
synchronized (fileChannel) {
|
||||
lock.close();
|
||||
try {
|
||||
lock.close();
|
||||
} catch (ClosedChannelException ignored) {
|
||||
}
|
||||
fileChannel.close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user