Prevents a memory leak if the caller clones into an SkPicture
that already has a playback or record.
Review URL: https://codereview.appspot.com/
6813081
git-svn-id: http://skia.googlecode.com/svn/trunk@6282
2bbb7eff-a529-9590-31e7-
b0007b416f81
clone->fHeight = fHeight;
clone->fRecord = NULL;
+ if (NULL != clone->fRecord) {
+ clone->fRecord->unref();
+ clone->fRecord = NULL;
+ }
+ SkDELETE(clone->fPlayback);
+
/* We want to copy the src's playback. However, if that hasn't been built
yet, we need to fake a call to endRecording() without actually calling
it (since it is destructive, and we don't want to change src).