diff options
| author | Adam Seaton <aseaton@google.com> | 2019-07-26 17:13:18 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-07-26 17:35:49 +0000 |
| commit | 90a3bc3372dc186fa08fd3fae8a0757eaa03d697 (patch) | |
| tree | 6e647f373a2d51831593395e7fb6ee0b79a1dfa1 | |
| parent | a7eed88f4e68c403d6a726283849bcd826238616 (diff) | |
Revert "SharedMemory: break Cleaner reference cycle."
Bug: 138422309
This reverts commit 390d9e6a1806626eb521d55a36b1578d28714cc8.
Reason for revert: crashes documented in b/138422309
Change-Id: I235f727d0fe87c09f6f05dddcae7759bab64dfd8
(cherry picked from commit b16411f83aee0847fec77d79fb4e98b2e3fa8828)
| -rw-r--r-- | core/java/android/os/SharedMemory.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/java/android/os/SharedMemory.java b/core/java/android/os/SharedMemory.java index 3e2ba3d3115f..57a88012a31a 100644 --- a/core/java/android/os/SharedMemory.java +++ b/core/java/android/os/SharedMemory.java @@ -62,7 +62,7 @@ public final class SharedMemory implements Parcelable, Closeable { mMemoryRegistration = new MemoryRegistration(mSize); mCleaner = Cleaner.create(mFileDescriptor, - new Closer(mFileDescriptor.getInt$(), mMemoryRegistration)); + new Closer(mFileDescriptor, mMemoryRegistration)); } /** @@ -290,10 +290,10 @@ public final class SharedMemory implements Parcelable, Closeable { * Cleaner that closes the FD */ private static final class Closer implements Runnable { - private int mFd; + private FileDescriptor mFd; private MemoryRegistration mMemoryReference; - private Closer(int fd, MemoryRegistration memoryReference) { + private Closer(FileDescriptor fd, MemoryRegistration memoryReference) { mFd = fd; mMemoryReference = memoryReference; } @@ -301,9 +301,7 @@ public final class SharedMemory implements Parcelable, Closeable { @Override public void run() { try { - FileDescriptor fd = new FileDescriptor(); - fd.setInt$(mFd); - Os.close(fd); + Os.close(mFd); } catch (ErrnoException e) { /* swallow error */ } mMemoryReference.release(); mMemoryReference = null; |
