Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 808e525d authored by Ytai Ben-Tsvi's avatar Ytai Ben-Tsvi
Browse files

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
parent cad4e327
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ public class HidlMemory implements Closeable {
    public void close() throws IOException {
        if (mHandle != null) {
            mHandle.close();
            mHandle = null;
        }
    }