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

Commit 972f3a56 authored by Andrew Walbran's avatar Andrew Walbran Committed by Automerger Merge Worker
Browse files

Merge "Implement Drop for WpIBinder, to avoid memory leak." am: 10308250 am:...

Merge "Implement Drop for WpIBinder, to avoid memory leak." am: 10308250 am: e064abcb am: 67aea209

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1531633

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I43c3654e912c69915776e9f69e6cf5d4b602636d
parents 147c86e7 67aea209
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -416,6 +416,16 @@ impl WpIBinder {
    }
}

impl Drop for WpIBinder {
    fn drop(&mut self) {
        unsafe {
            // Safety: WpIBinder always holds a valid `AIBinder_Weak` pointer, so we
            // know this pointer is safe to pass to `AIBinder_Weak_delete` here.
            sys::AIBinder_Weak_delete(self.0);
        }
    }
}

/// Rust wrapper around DeathRecipient objects.
#[repr(C)]
pub struct DeathRecipient {