diff options
author | 2017-06-29 11:19:42 -0400 | |
---|---|---|
committer | 2017-06-29 15:51:17 +0000 | |
commit | 185a3798db64c64d47ef89a5fd3d4c5c70f1e621 (patch) | |
tree | 2014d366f021406493e8fe035731d32e4cba7034 /include/core/SkImageFilter.h | |
parent | 9026fe13a751582e58e98f9bf735c18b4719d7fe (diff) |
Fix memory leak in SkImageFilter
In our current implementation of SkImageFilterCache, when the
removeInternal() function is called, the Value is removed, but their
corresponding keys are not always removed in SkImageFilter. That could
result in memory leak.
In this CL, we made changes such that the Value structure now keeps
a pointer to the SkImageFilter. Each time when the removeInternal()
is called, we ask the SkImageFilter to remove the associated keys.
Bug: 689740
Change-Id: I0807fa3581881ad1530536df5289e3976792281f
Reviewed-on: https://skia-review.googlesource.com/20960
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'include/core/SkImageFilter.h')
-rw-r--r-- | include/core/SkImageFilter.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h index ee3abbd067..2af0ee3e6e 100644 --- a/include/core/SkImageFilter.h +++ b/include/core/SkImageFilter.h @@ -173,6 +173,8 @@ public: return this->isColorFilterNode(filterPtr); } + void removeKey(const SkImageFilterCacheKey& key) const; + /** * Returns true (and optionally returns a ref'd filter) if this imagefilter can be completely * replaced by the returned colorfilter. i.e. the two effects will affect drawing in the |