diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/images/SkImageRef.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/images/SkImageRef.cpp b/src/images/SkImageRef.cpp index 90c37b65e1..8b14375582 100644 --- a/src/images/SkImageRef.cpp +++ b/src/images/SkImageRef.cpp @@ -15,8 +15,7 @@ SkImageRef::SkImageRef(SkStream* stream, SkBitmap::Config config, int sampleSize) : SkPixelRef(&gImageRefMutex), fErrorInDecoding(false) { SkASSERT(stream); - SkASSERT(1 == stream->getRefCnt()); - + stream->ref(); fStream = stream; fConfig = config; fSampleSize = sampleSize; @@ -36,7 +35,7 @@ SkImageRef::~SkImageRef() { this, fConfig, (int)fStream->getLength()); #endif - delete fStream; + fStream->unref(); } bool SkImageRef::getInfo(SkBitmap* bitmap) { |