Android: Close the DataOutputStream when we are finished with it
Task-number: QTBUG-66769 Change-Id: I93c49baa0ccab4f853402d9be675af1c50b2e0c1 Reviewed-by: Christian Stromme <christian.stromme@qt.io>bb10
parent
d8b143d4b7
commit
ccdcf8c4f2
|
|
@ -677,12 +677,13 @@ public class QtActivityDelegate
|
|||
final int timeOut = 30000; // ms until we give up on ping and pong
|
||||
final int maxAttempts = timeOut / napTime;
|
||||
|
||||
DataOutputStream outToClient = null;
|
||||
try {
|
||||
LocalSocket connectionFromClient = socket.accept();
|
||||
debugLog("Debug socket accepted");
|
||||
BufferedReader inFromClient =
|
||||
new BufferedReader(new InputStreamReader(connectionFromClient.getInputStream()));
|
||||
DataOutputStream outToClient = new DataOutputStream(connectionFromClient.getOutputStream());
|
||||
outToClient = new DataOutputStream(connectionFromClient.getOutputStream());
|
||||
outToClient.writeBytes("" + android.os.Process.myPid());
|
||||
|
||||
for (int i = 0; i < maxAttempts; i++) {
|
||||
|
|
@ -704,6 +705,11 @@ public class QtActivityDelegate
|
|||
} catch (InterruptedException interruptEx) {
|
||||
wasFailure = true;
|
||||
Log.e(QtNative.QtTAG,"Can't start debugger" + interruptEx.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
if (outToClient != null)
|
||||
outToClient.close();
|
||||
} catch (IOException ignored) { }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue