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

Commit 00a66754 authored by Craig Mautner's avatar Craig Mautner
Browse files

Add null check and call destroy from single point.

Ensure that calling destroy() on a DimLayer surface only happens
once.

Fixes bug 19660387.

Change-Id: Iee8ea20b5d7c3a8f81f14a3ecff66a1dc1a8d719
parent 35617617
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -373,10 +373,8 @@ public class TaskStack {
            mService.requestTraversalLocked();
        }

        mAnimationBackgroundSurface.destroySurface();
        mAnimationBackgroundSurface = null;
        mDimLayer.destroySurface();
        mDimLayer = null;
        close();

        mDisplayContent = null;
    }

@@ -501,8 +499,14 @@ public class TaskStack {
    }

    void close() {
        mDimLayer.mDimSurface.destroy();
        mAnimationBackgroundSurface.mDimSurface.destroy();
        if (mAnimationBackgroundSurface != null) {
            mAnimationBackgroundSurface.destroySurface();
            mAnimationBackgroundSurface = null;
        }
        if (mDimLayer != null) {
            mDimLayer.destroySurface();
            mDimLayer = null;
        }
    }

    public void dump(String prefix, PrintWriter pw) {