fix destructor order to fix build

TBR=reed

Review URL: https://codereview.chromium.org/1033703002
diff --git a/src/pathops/SkOpContour.h b/src/pathops/SkOpContour.h
index be1f59f..495b643 100644
--- a/src/pathops/SkOpContour.h
+++ b/src/pathops/SkOpContour.h
@@ -20,6 +20,12 @@
         reset();
     }
 
+    ~SkOpContour() {
+        if (fNext) {
+            fNext->~SkOpContour();
+        }
+    }
+
     bool operator<(const SkOpContour& rh) const {
         return fBounds.fTop == rh.fBounds.fTop
                 ? fBounds.fLeft < rh.fBounds.fLeft
@@ -61,7 +67,7 @@
 
     SkOpContour* appendContour(SkChunkAlloc* allocator) {
         SkOpContour* contour = SkOpTAllocator<SkOpContour>::New(allocator);
-        
+        contour->setNext(NULL);
         SkOpContour* prev = this;
         SkOpContour* next;
         while ((next = prev->next())) {
@@ -273,7 +279,7 @@
     }
 
     void setNext(SkOpContour* contour) {
-        SkASSERT(!fNext == !!contour);
+//        SkASSERT(!fNext == !!contour);
         fNext = contour;
     }
 
diff --git a/src/pathops/SkPathOpsCommon.cpp b/src/pathops/SkPathOpsCommon.cpp
index b0fd822..1dc171c 100644
--- a/src/pathops/SkPathOpsCommon.cpp
+++ b/src/pathops/SkPathOpsCommon.cpp
@@ -440,12 +440,12 @@
         reassemble contour pieces into new path
     */
 void Assemble(const SkPathWriter& path, SkPathWriter* simple) {
+    SkChunkAlloc allocator(4096);  // FIXME: constant-ize, tune
     SkOpContour contour;
     SkOpGlobalState globalState(NULL  PATH_OPS_DEBUG_PARAMS(&contour));
 #if DEBUG_PATH_CONSTRUCTION
     SkDebugf("%s\n", __FUNCTION__);
 #endif
-    SkChunkAlloc allocator(4096);  // FIXME: constant-ize, tune
     SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState);
     builder.finish(&allocator);
     SkTDArray<const SkOpContour* > runs;  // indices of partial contours
diff --git a/src/pathops/SkPathOpsOp.cpp b/src/pathops/SkPathOpsOp.cpp
index 77ae2de..3182ac3 100644
--- a/src/pathops/SkPathOpsOp.cpp
+++ b/src/pathops/SkPathOpsOp.cpp
@@ -261,6 +261,7 @@
 #endif
 
 bool Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result) {
+    SkChunkAlloc allocator(4096);  // FIXME: add a constant expression here, tune
     SkOpContour contour;
     SkOpCoincidence coincidence;
     SkOpGlobalState globalState(&coincidence  PATH_OPS_DEBUG_PARAMS(&contour));
@@ -288,7 +289,6 @@
     SkPathOpsDebug::gSortCount = SkPathOpsDebug::gSortCountDefault;
 #endif
     // turn path into list of segments
-    SkChunkAlloc allocator(4096);  // FIXME: add a constant expression here, tune
     SkOpEdgeBuilder builder(*minuend, &contour, &allocator, &globalState);
     if (builder.unparseable()) {
         return false;
diff --git a/src/pathops/SkPathOpsSimplify.cpp b/src/pathops/SkPathOpsSimplify.cpp
index 7a234ec..5c8a7fd 100644
--- a/src/pathops/SkPathOpsSimplify.cpp
+++ b/src/pathops/SkPathOpsSimplify.cpp
@@ -177,6 +177,7 @@
 
 // FIXME : add this as a member of SkPath
 bool Simplify(const SkPath& path, SkPath* result) {
+    SkChunkAlloc allocator(4096);  // FIXME: constant-ize, tune
     // returns 1 for evenodd, -1 for winding, regardless of inverse-ness
     SkPath::FillType fillType = path.isInverseFillType() ? SkPath::kInverseEvenOdd_FillType
             : SkPath::kEvenOdd_FillType;
@@ -194,7 +195,6 @@
 #if DEBUG_SORT || DEBUG_SWAP_TOP
     SkPathOpsDebug::gSortCount = SkPathOpsDebug::gSortCountDefault;
 #endif
-    SkChunkAlloc allocator(4096);  // FIXME: constant-ize, tune
     SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState);
     if (!builder.finish(&allocator)) {
         return false;
diff --git a/src/pathops/SkPathOpsTightBounds.cpp b/src/pathops/SkPathOpsTightBounds.cpp
index d03efeb..2f09f41 100644
--- a/src/pathops/SkPathOpsTightBounds.cpp
+++ b/src/pathops/SkPathOpsTightBounds.cpp
@@ -8,10 +8,10 @@
 #include "SkPathOpsCommon.h"
 
 bool TightBounds(const SkPath& path, SkRect* result) {
+    SkChunkAlloc allocator(4096);  // FIXME: constant-ize, tune
     SkOpContour contour;
     SkOpGlobalState globalState( NULL  PATH_OPS_DEBUG_PARAMS(&contour));
     // turn path into list of segments
-    SkChunkAlloc allocator(4096);  // FIXME: constant-ize, tune
     SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState);
     if (!builder.finish(&allocator)) {
         return false;