Index: src/core/SkPicture.cpp |
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp |
index e226c2642ac1e0d4a6ad23a8ce4a218795937c06..7762939c5d512a22b15e2e130086867f0f325e2b 100644 |
--- a/src/core/SkPicture.cpp |
+++ b/src/core/SkPicture.cpp |
@@ -164,12 +164,7 @@ void SkPicture::clone(SkPicture* pictures, int count) const { |
clone->fWidth = fWidth; |
clone->fHeight = fHeight; |
- clone->fRecord = NULL; |
- |
- if (NULL != clone->fRecord) { |
- clone->fRecord->unref(); |
- clone->fRecord = NULL; |
- } |
+ SkSafeSetNull(clone->fRecord); |
scroggo
2014/02/14 15:07:40
SkSafeSetNull seems like a bad name to me - it's n
|
SkDELETE(clone->fPlayback); |
/* We want to copy the src's playback. However, if that hasn't been built |
@@ -196,10 +191,7 @@ SkCanvas* SkPicture::beginRecording(int width, int height, |
fPlayback = NULL; |
} |
- if (NULL != fRecord) { |
- fRecord->unref(); |
- fRecord = NULL; |
- } |
+ SkSafeSetNull(fRecord); |
SkBitmap bm; |
bm.setConfig(SkBitmap::kNo_Config, width, height); |
@@ -246,8 +238,7 @@ void SkPicture::endRecording() { |
if (NULL != fRecord) { |
fRecord->endRecording(); |
fPlayback = SkNEW_ARGS(SkPicturePlayback, (*fRecord)); |
- fRecord->unref(); |
- fRecord = NULL; |
+ SkSafeSetNull(fRecord); |
} |
} |
SkASSERT(NULL == fRecord); |