Index: samplecode/SampleAnimator.cpp |
diff --git a/samplecode/SampleAnimator.cpp b/samplecode/SampleAnimator.cpp |
index 50b61bad93fe2a5992a516deb7e3a4099280795d..a7cc8851ea462bcac0353846f89a0a31060ab44d 100644 |
--- a/samplecode/SampleAnimator.cpp |
+++ b/samplecode/SampleAnimator.cpp |
@@ -51,15 +51,13 @@ void SkAnimatorView::setURIBase(const char dir[]) { |
} |
bool SkAnimatorView::decodeFile(const char path[]) { |
- SkFILEStream* is = new SkFILEStream(path); |
- SkAutoUnref aur(is); |
- return is->isValid() && this->decodeStream(is); |
+ SkAutoTDelete<SkStream> is(SkStream::NewFromFile(path)); |
+ return is.get() != NULL && this->decodeStream(is); |
} |
bool SkAnimatorView::decodeMemory(const void* buffer, size_t size) { |
- SkMemoryStream* is = new SkMemoryStream(buffer, size); |
- SkAutoUnref aur(is); |
- return this->decodeStream(is); |
+ SkMemoryStream is(buffer, size); |
+ return this->decodeStream(&is); |
} |
static const SkDOMNode* find_nodeID(const SkDOM& dom, |