mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Ignore closed channel exception when closing the channel lock
This commit is contained in:
parent
a83924238f
commit
4177deccf1
1 changed files with 5 additions and 1 deletions
|
@ -38,6 +38,7 @@ import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.RandomAccessFile;
|
import java.io.RandomAccessFile;
|
||||||
import java.nio.channels.Channels;
|
import java.nio.channels.Channels;
|
||||||
|
import java.nio.channels.ClosedChannelException;
|
||||||
import java.nio.channels.FileChannel;
|
import java.nio.channels.FileChannel;
|
||||||
import java.nio.channels.FileLock;
|
import java.nio.channels.FileLock;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -429,7 +430,10 @@ public class SignalAccount implements Closeable {
|
||||||
@Override
|
@Override
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
synchronized (fileChannel) {
|
synchronized (fileChannel) {
|
||||||
|
try {
|
||||||
lock.close();
|
lock.close();
|
||||||
|
} catch (ClosedChannelException ignored) {
|
||||||
|
}
|
||||||
fileChannel.close();
|
fileChannel.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue