Prevent double-closing of native handle in HidlMemory
Since the handle wasn't nullified, when the memory is explicitly
closed, the finalizer would attempt to close again, which results in
an exception.
Bug: 189213084
Test: Manual verification of ST use-cases, which uses this.
Patch sent to partner for verification.
Change-Id: I4ac6bbdd88b3f729a022896adfed00effec48bd8
This commit is contained in:
@@ -79,6 +79,7 @@ public class HidlMemory implements Closeable {
|
||||
public void close() throws IOException {
|
||||
if (mHandle != null) {
|
||||
mHandle.close();
|
||||
mHandle = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user