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

Commit 35274cb0 authored by Robert Carr's avatar Robert Carr
Browse files

ViewRoot: Ensure we release surface from setWindowStopped.

Otherwise, we may attempt to reinitialize the ThreadedRenderer with
a Surface which is not actually valid, e.g. from handleWindowFocusChanged.
Entering a code path where the threaded renderer does not heed the
stopped signal. This change ensures isValid returns false when the Surface
is not valid preventing us from calling initialize/initializeIfNeeded, or
udpateSurface.

Bug: 62536731
Test: For the monkeys.
Change-Id: I65939a29db4db70c6eb6bc4b258a9ed09a86e0ce
parent 8ec69c71
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1334,6 +1334,7 @@ public final class ViewRootImpl implements ViewParent,
                if (renderer != null) {
                    renderer.destroyHardwareResources(mView);
                }
                mSurface.release();
            }

            for (int i = 0; i < mWindowStoppedCallbacks.size(); i++) {