Bug 1202794 - Explicitly clear array in SortChildrenBy3DZOrder to satisfy the move analysis, r=mattwoodrow

This commit is contained in:
Michael Layzell 2015-09-08 14:22:02 -04:00
Родитель 469890ae16
Коммит b4d95d7c97
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1197,6 +1197,12 @@ ContainerLayer::SortChildrenBy3DZOrder(nsTArray<Layer*>& aArray)
if (toSort.Length() > 0) {
SortLayersBy3DZOrder(toSort);
aArray.AppendElements(Move(toSort));
// XXX The move analysis gets confused here, because toSort gets moved
// here, and then gets used again outside of the loop. To clarify that
// we realize that the array is going to be empty to the move checker,
// we clear it again here. (This method renews toSort for the move
// analysis)
toSort.ClearAndRetainStorage();
}
aArray.AppendElement(l);
}