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

Commit 6ce9ffb2 authored by Robert Carr's avatar Robert Carr Committed by Rob Carr
Browse files

SurfaceView: Lock mDeferredDestroySurfaceControl

Since mDeferredDestroySurfaceControl is the same underlying
object as mSurfaceControl we also need to hold the mSurfaceControlLock
when writing to it.

Bug: 157657896
Test: Existing tests pass
Change-Id: Ie0da3ed5d94c7aae2593423fa2767dbc902da4c8
parent 54eec4b7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1200,9 +1200,11 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
        }

        if (mDeferredDestroySurfaceControl != null) {
            synchronized (mSurfaceControlLock) {
                mTmpTransaction.remove(mDeferredDestroySurfaceControl).apply();
                mDeferredDestroySurfaceControl = null;
            }
        }

        runOnUiThread(this::performDrawFinished);
    }