mirror of
https://github.com/Genymobile/scrcpy
synced 2024-12-22 15:13:17 +00:00
Close connection at the end of finally-block
The async processors use the socket file descriptors from the connection. Therefore, the connection must not be closed before all async processor threads are joined. PR #3978 <https://github.com/Genymobile/scrcpy/pull/3978>
This commit is contained in:
parent
92483fe11b
commit
9c08eb79cb
@ -92,7 +92,8 @@ public final class Server {
|
||||
|
||||
List<AsyncProcessor> asyncProcessors = new ArrayList<>();
|
||||
|
||||
try (DesktopConnection connection = DesktopConnection.open(scid, tunnelForward, audio, control, sendDummyByte)) {
|
||||
DesktopConnection connection = DesktopConnection.open(scid, tunnelForward, audio, control, sendDummyByte);
|
||||
try {
|
||||
if (options.getSendDeviceMeta()) {
|
||||
connection.sendDeviceMeta(Device.getDeviceName());
|
||||
}
|
||||
@ -150,6 +151,8 @@ public final class Server {
|
||||
} catch (InterruptedException e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user