From b4d95d7c9730b48dc4e19b10ee09e46d39343116 Mon Sep 17 00:00:00 2001 From: Michael Layzell Date: Tue, 8 Sep 2015 14:22:02 -0400 Subject: [PATCH] Bug 1202794 - Explicitly clear array in SortChildrenBy3DZOrder to satisfy the move analysis, r=mattwoodrow --- gfx/layers/Layers.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 296c7cdfdbe5..1ae18e7ee413 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -1197,6 +1197,12 @@ ContainerLayer::SortChildrenBy3DZOrder(nsTArray& 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); }