Index: samplecode/SampleApp.cpp |
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp |
index 380511f7baadff387c457e29fe0de3670538950a..3825197690395c80deb79f575e4a50aec83fcab1 100644 |
--- a/samplecode/SampleApp.cpp |
+++ b/samplecode/SampleApp.cpp |
@@ -1379,8 +1379,10 @@ void SampleWindow::afterChildren(SkCanvas* orig) { |
SkAutoDataUnref data(ostream.copyToData()); |
SkMemoryStream istream(data->data(), data->size()); |
- SkPicture pict(&istream); |
- orig->drawPicture(pict); |
+ SkAutoTUnref<SkPicture> pict(SkPicture::CreateFromStream(&istream)); |
+ if (pict.get() != NULL) { |
+ orig->drawPicture(*pict.get()); |
+ } |
} else { |
fPicture->draw(orig); |
fPicture->unref(); |