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 {
|
try {
|
||||||
root.setView(view, wparams, panelParentView, userId);
|
root.setView(view, wparams, panelParentView, userId);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
|
final int viewIndex = findViewLocked(view, false);
|
||||||
// BadTokenException or InvalidDisplayException, clean up.
|
// BadTokenException or InvalidDisplayException, clean up.
|
||||||
if (index >= 0) {
|
if (viewIndex >= 0) {
|
||||||
removeViewLocked(index, true);
|
removeViewLocked(viewIndex, true);
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user