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

Commit cb882f90 authored by Jeff Brown's avatar Jeff Brown
Browse files

Fix bug removing all windows that belong to a display.

Removing one window causes its subwindows to also be removed.
We have to be careful when traversing the window list
because multiple windows may be removed at a time so we
don't get IndexOutOfBoundsException due to the window
list changing in unexpected ways.

Bug: 7273702
Change-Id: I0ed9ba00c325ad178ab28919ce2e763cb6fd38ba
parent c2726643
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -10870,8 +10870,8 @@ public class WindowManagerService extends IWindowManager.Stub
        final DisplayContent displayContent = getDisplayContentLocked(displayId);
        mDisplayContents.delete(displayId);
        WindowList windows = displayContent.getWindowList();
        for (int i = windows.size() - 1; i >= 0; --i) {
            final WindowState win = windows.get(i);
        while (!windows.isEmpty()) {
            final WindowState win = windows.get(windows.size() - 1);
            removeWindowLocked(win.mSession, win);
        }
        mAnimator.removeDisplayLocked(displayId);