Merge "Fix View leakage from mPreSortedChildren" into nyc-dev

am: 4e34cd0537

* commit '4e34cd05379d1e96a5ca8081b3e3fa3b1a1cc534':
  Fix View leakage from mPreSortedChildren

Change-Id: I4a2c7016907c22bcb4ae9640aa1feb5a0f812bbb
This commit is contained in:
Chris Craik
2016-05-04 22:30:27 +00:00
committed by android-build-merger

View File

@@ -1718,11 +1718,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if (isTransformedTouchPointInView(x, y, child, point)) {
final PointerIcon pointerIcon = child.getPointerIcon(event, point.x, point.y);
if (pointerIcon != null) {
if (preorderedList != null) preorderedList.clear();
return pointerIcon;
}
break;
}
}
if (preorderedList != null) preorderedList.clear();
}
// The pointer is not a child or the child has no preferences, returning the default
@@ -3028,6 +3030,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
final ViewStructure cstructure = structure.newChild(i);
child.dispatchProvideStructure(cstructure);
}
if (preorderedList != null) preorderedList.clear();
}
}
}
@@ -3619,6 +3622,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if (mPreSortedChildren == null) {
mPreSortedChildren = new ArrayList<>(childrenCount);
} else {
// callers should clear, so clear shouldn't be necessary, but for safety...
mPreSortedChildren.clear();
mPreSortedChildren.ensureCapacity(childrenCount);
}