aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-03-16 13:56:10 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-03-16 13:56:10 +0000
commit1337a7b14c84d2d0bbc077bd0ac521eff05045b9 (patch)
tree195ca870b0f6a41487f8008240835bb9b6e72349 /src
parent791f5a11f22abfa7f8f90c37c98a5f654c7fb4c5 (diff)
see prev. checkin (missed these files). Change ownership rule for streams to the
skia std. of receiver calls ref() if it needs to, but regardless, the caller always manages/balances its own ownership. git-svn-id: http://skia.googlecode.com/svn/trunk@121 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/images/SkImageRef.cpp5
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) {