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

Commit 30256032 authored by Matthew Maurer's avatar Matthew Maurer Committed by Automerger Merge Worker
Browse files

Merge "binder: rust: Fix dropped service memleak" into sc-dev am: b4eff207 am: 209b97cc

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

Change-Id: I841b424b28743908e9fffef467cec8c45bd21098
parents 6595ac62 209b97cc
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -24,7 +24,6 @@ use std::convert::TryFrom;
use std::ffi::{c_void, CString};
use std::ffi::{c_void, CString};
use std::mem::ManuallyDrop;
use std::mem::ManuallyDrop;
use std::ops::Deref;
use std::ops::Deref;
use std::ptr;


/// Rust wrapper around Binder remotable objects.
/// Rust wrapper around Binder remotable objects.
///
///
@@ -273,7 +272,7 @@ impl<T: Remotable> InterfaceClassMethods for Binder<T> {
    /// Must be called with a valid pointer to a `T` object. After this call,
    /// Must be called with a valid pointer to a `T` object. After this call,
    /// the pointer will be invalid and should not be dereferenced.
    /// the pointer will be invalid and should not be dereferenced.
    unsafe extern "C" fn on_destroy(object: *mut c_void) {
    unsafe extern "C" fn on_destroy(object: *mut c_void) {
        ptr::drop_in_place(object as *mut T)
        Box::from_raw(object as *mut T);
    }
    }


    /// Called whenever a new, local `AIBinder` object is needed of a specific
    /// Called whenever a new, local `AIBinder` object is needed of a specific