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

Commit 9e3cd053 authored by chaviw's avatar chaviw
Browse files

Remove lock when calling Surface.destroy

Surface already has a lock on the native object so it's safe to call
destroy without holding additional locks. This also fixes ANR issues
where an app is still attempting to render when the window is destroyed.

Test: App from bug doesn't ANR
Bug: 234006724
Change-Id: I0d323c03f299e5857d1950870498f3182d019924
parent 91d28d1b
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -719,13 +719,8 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall

    private void releaseSurfaces(boolean releaseSurfacePackage) {
        mSurfaceAlpha = 1f;
	
        mSurfaceLock.lock();
        try {
        mSurface.destroy();
        } finally {
            mSurfaceLock.unlock();
        }

        synchronized (mSurfaceControlLock) {
            if (mBlastBufferQueue != null) {
                mBlastBufferQueue.destroy();