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

Commit d807c310 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "Fixed BaseObj finalizer and destroy()" into nyc-dev am: 8ca76380...

Merge "Merge "Fixed BaseObj finalizer and destroy()" into nyc-dev am: 8ca76380 am: 888017db" into nyc-mr1-dev-plus-aosp
parents 7c608b86 43b34c10
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -392,8 +392,6 @@ public class Allocation extends BaseObj {

    protected void finalize() throws Throwable {
        RenderScript.registerNativeFree.invoke(RenderScript.sRuntime, mSize);
        // Set mType null to avoid double-destroying it in case its finalizer races ahead
        mType = null;
        super.finalize();
    }

@@ -2615,7 +2613,6 @@ public class Allocation extends BaseObj {

        if (mType != null && mOwningType) {
            mType.destroy();
            mType = null;
        }

        super.destroy();
+5 −12
Original line number Diff line number Diff line
@@ -1066,19 +1066,12 @@ public final class ScriptGroup extends BaseObj {
     */
    public void destroy() {
        super.destroy();
        // ScriptGroup created using the old Builder class does not
        // initialize the field mClosures
        if (mClosures != null) {
            for (Closure c : mClosures) {
                c.destroy();
            }
        }

    protected void finalize() throws Throwable {
        // Clear out the list mClosures to avoid double-destroying the closures,
        // in case their finalizers race ahead.
        if (mClosures != null) {
            // ScriptGroup created using the old Builder class does not
            // initialize the field mClosures
            mClosures.clear();
        }
        super.finalize();
    }
}