diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-14 17:27:10 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-14 17:27:10 +0000 |
commit | 550db50db324a6487904ec268d86e9abe68a4d70 (patch) | |
tree | 9dec7521b683b19585a546b768c04627936aa1ed /src | |
parent | 54318d3430a436771b922f551fe69290f6d5d977 (diff) |
Cleanup unref and null
BUG=skia:
R=mtklein@google.com, scroggo@google.com, iancottrell@chromium.org
Author: iancottrell@google.com
Review URL: https://codereview.chromium.org/163053005
git-svn-id: http://skia.googlecode.com/svn/trunk@13457 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkPicture.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp index e226c2642a..7762939c5d 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); 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); |