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

Commit 07837d6d authored by Yang Ni's avatar Yang Ni
Browse files

Fixed ScriptGroup finalizer for old API

Bug: 28242626

ScriptGroup finalizer clears out the list of closures, which is
uninitialized for the old API.

Need to check null first, before accessing the list.

Change-Id: Ibf914e17a0878c8c561f823c5f6f6f6619594de1
parent 8dd32a56
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1074,7 +1074,11 @@ public final class ScriptGroup extends BaseObj {
    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();
    }
}