diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-18 16:26:25 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-18 16:26:25 +0000 |
commit | 701b40543d5d124dfa1e59b051cba9d2aaf61670 (patch) | |
tree | 25383c51b0a3dd19ce67fb947ad74885bb360af0 /include/core | |
parent | e61a86cfa00ea393ecc4a71fca94e1d476a37ecc (diff) |
Fix DocumentTest/SkDocument memory leaks
https://codereview.chromium.org/72833002/
git-svn-id: http://skia.googlecode.com/svn/trunk@12302 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkDocument.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/core/SkDocument.h b/include/core/SkDocument.h index 66946fe7c5..83b4e7a3ee 100644 --- a/include/core/SkDocument.h +++ b/include/core/SkDocument.h @@ -64,6 +64,9 @@ public: * The proc can delete the stream, or whatever it needs to do. * encoder sets the DCTEncoder for images, to encode a bitmap * as JPEG (DCT). + * Done - clean up method intended to allow deletion of the stream. + * Its aborted parameter is true if the cleanup is due to an abort + * call. It is false otherwise. * rasterDpi - the DPI at which features without native PDF support * will be rasterized (e.g. draw image with perspective, * draw text with perspective, ...) @@ -73,7 +76,7 @@ public: * and it would be slower to be processed or sent online or * to printer. */ static SkDocument* CreatePDF( - SkWStream*, void (*Done)(SkWStream*) = NULL, + SkWStream*, void (*Done)(SkWStream*,bool aborted) = NULL, SkPicture::EncodeBitmap encoder = NULL, SkScalar rasterDpi = SK_ScalarDefaultRasterDPI); @@ -108,7 +111,7 @@ public: void abort(); protected: - SkDocument(SkWStream*, void (*)(SkWStream*)); + SkDocument(SkWStream*, void (*)(SkWStream*, bool aborted)); // note: subclasses must call close() in their destructor, as the base class // cannot do this for them. virtual ~SkDocument(); @@ -128,7 +131,7 @@ protected: private: SkWStream* fStream; - void (*fDoneProc)(SkWStream*); + void (*fDoneProc)(SkWStream*, bool aborted); State fState; typedef SkRefCnt INHERITED; |