SharedMemory: clear file descriptor when explicitly closed.
We run the Cleaner in close, but after the fix in commit 6ca916a6, this no longer clears the value stored in the FileDescriptor, which means that subsequent operations on an explicitly closed SharedMemory will operate on a bogus fd number. Clearing the FileDescriptor value in close is sufficient, because Cleaner.clean is idempotent, and the only other case where it executes is when the FileDescriptor is phantom reachable, which means no one can access it to get its integer value. Bug: http://b/138392115 Bug: http://b/138323667 Test: treehugger Change-Id: I8bdb4c745466532a0712976416184c53fcf0dbf6 (cherry picked from commit a7641806)
Loading
Please register or sign in to comment