aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2011-03-08 18:48:43 +0800
committerChih-Chung Chang <chihchung@google.com>2011-03-08 18:48:43 +0800
commit6210a7c68844602ee390bcce61dbb637910a3c6b (patch)
tree5d192927491d40a8ce54ce914ff183ffb14e991b /include
parent71531ca1f484da5837be8017a0c83e5bff701587 (diff)
downloadexternal_skia-6210a7c68844602ee390bcce61dbb637910a3c6b.zip
external_skia-6210a7c68844602ee390bcce61dbb637910a3c6b.tar.gz
external_skia-6210a7c68844602ee390bcce61dbb637910a3c6b.tar.bz2
Fix 3510563: memory leak in BitmapRegionDecoder.
Change-Id: I30b3a3806f4484d95602539def1a77a366560fdf
Diffstat (limited to 'include')
-rw-r--r--include/images/SkBitmapRegionDecoder.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/images/SkBitmapRegionDecoder.h b/include/images/SkBitmapRegionDecoder.h
index 5b35371..c039c1b 100644
--- a/include/images/SkBitmapRegionDecoder.h
+++ b/include/images/SkBitmapRegionDecoder.h
@@ -4,16 +4,20 @@
#include "SkBitmap.h"
#include "SkRect.h"
#include "SkImageDecoder.h"
+#include "SkStream.h"
class SkBitmapRegionDecoder {
public:
- SkBitmapRegionDecoder(SkImageDecoder *decoder, int width, int height) {
+ SkBitmapRegionDecoder(SkImageDecoder *decoder, SkStream *stream,
+ int width, int height) {
fDecoder = decoder;
+ fStream = stream;
fWidth = width;
fHeight = height;
}
virtual ~SkBitmapRegionDecoder() {
delete fDecoder;
+ fStream->unref();
}
virtual bool decodeRegion(SkBitmap* bitmap, SkIRect rect,
@@ -26,6 +30,7 @@ public:
private:
SkImageDecoder *fDecoder;
+ SkStream *fStream;
int fWidth;
int fHeight;
};