Merge "Make sure to cleanup views that couldn't be added" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c01cce0313
@@ -404,9 +404,10 @@ public final class WindowManagerGlobal {
|
||||
try {
|
||||
root.setView(view, wparams, panelParentView, userId);
|
||||
} catch (RuntimeException e) {
|
||||
final int viewIndex = findViewLocked(view, false);
|
||||
// BadTokenException or InvalidDisplayException, clean up.
|
||||
if (index >= 0) {
|
||||
removeViewLocked(index, true);
|
||||
if (viewIndex >= 0) {
|
||||
removeViewLocked(viewIndex, true);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user