Index: src/core/SkPictureData.cpp |
diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp |
index fc4fdb8230d14655555b8ab35c4d4cf5beb8a2de..f9d710aa895bf96a01db72654f320a5ffbca9af1 100644 |
--- a/src/core/SkPictureData.cpp |
+++ b/src/core/SkPictureData.cpp |
@@ -385,13 +385,8 @@ bool SkPictureData::parseStreamTag(SkStream* stream, |
} |
} |
if (!success) { |
- // Delete all of the pictures that were already created (up to but excluding i): |
- for (int j = 0; j < i; j++) { |
- fPictureRefs[j]->unref(); |
- } |
- // Delete the array |
- SkDELETE_ARRAY(fPictureRefs); |
- fPictureCount = 0; |
+ // The destructor unrefs fPictureCount fPictureRefs, and deletes the array. |
+ fPictureCount = i; |
return false; |
} |
} break; |