am 02f042dd
: Fix socket descriptor leak from Zygote to child app
* commit '02f042ddd9ddf47ef88c4f174eb19a9bee296a45': Fix socket descriptor leak from Zygote to child app
This commit is contained in:
@ -192,10 +192,16 @@ public class ZygoteInit {
|
|||||||
static void closeServerSocket() {
|
static void closeServerSocket() {
|
||||||
try {
|
try {
|
||||||
if (sServerSocket != null) {
|
if (sServerSocket != null) {
|
||||||
|
FileDescriptor fd = sServerSocket.getFileDescriptor();
|
||||||
sServerSocket.close();
|
sServerSocket.close();
|
||||||
|
if (fd != null) {
|
||||||
|
Libcore.os.close(fd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Log.e(TAG, "Zygote: error closing sockets", ex);
|
Log.e(TAG, "Zygote: error closing sockets", ex);
|
||||||
|
} catch (libcore.io.ErrnoException ex) {
|
||||||
|
Log.e(TAG, "Zygote: error closing descriptor", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
sServerSocket = null;
|
sServerSocket = null;
|
||||||
|
Reference in New Issue
Block a user