diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-24 18:33:07 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-24 18:33:07 +0000 |
commit | 227c24673196f5f06bee85e7e9aa067be90e1359 (patch) | |
tree | 0c9cb5e49e880dfff5936bb3b3be5509c26e1a33 /src | |
parent | dd10e0ec4c9aeeadcd922d3ad0bf01496d920978 (diff) |
Resolve a few memory leaks in tests.
Purge the global scaled image cache after use in tests. The cache was
right to hold on to the pixels indefinitely, but this change makes it
easier to run down actual memory leaks.
Add SK_DECLARE_INST_COUNT to several classes.
BUG=skia:
R=reed@google.com
Author: halcanary@google.com
Review URL: https://codereview.chromium.org/145443004
git-svn-id: http://skia.googlecode.com/svn/trunk@13171 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkScaledImageCache.cpp | 1 | ||||
-rw-r--r-- | src/lazy/SkCachingPixelRef.h | 1 | ||||
-rw-r--r-- | src/lazy/SkDiscardablePixelRef.h | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp index d87597315f..2bc692a51b 100644 --- a/src/core/SkScaledImageCache.cpp +++ b/src/core/SkScaledImageCache.cpp @@ -192,6 +192,7 @@ void SkScaledImageCache::init() { class SkOneShotDiscardablePixelRef : public SkPixelRef { public: + SK_DECLARE_INST_COUNT(SkOneShotDiscardablePixelRef) // Ownership of the discardablememory is transfered to the pixelref SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_t rowBytes); ~SkOneShotDiscardablePixelRef(); diff --git a/src/lazy/SkCachingPixelRef.h b/src/lazy/SkCachingPixelRef.h index 905ee9bf0d..b73a2ca443 100644 --- a/src/lazy/SkCachingPixelRef.h +++ b/src/lazy/SkCachingPixelRef.h @@ -25,6 +25,7 @@ class SkColorTable; */ class SkCachingPixelRef : public SkPixelRef { public: + SK_DECLARE_INST_COUNT(SkCachingPixelRef) /** * Takes ownership of SkImageGenerator. If this method fails for * whatever reason, it will return false and immediatetely delete diff --git a/src/lazy/SkDiscardablePixelRef.h b/src/lazy/SkDiscardablePixelRef.h index 4a013fda03..cbc2a89ac4 100644 --- a/src/lazy/SkDiscardablePixelRef.h +++ b/src/lazy/SkDiscardablePixelRef.h @@ -24,6 +24,7 @@ */ class SkDiscardablePixelRef : public SkPixelRef { public: + SK_DECLARE_INST_COUNT(SkDiscardablePixelRef) SK_DECLARE_UNFLATTENABLE_OBJECT() protected: |