diff options
author | Sangkyu Lee <geteuid@gmail.com> | 2015-12-11 16:05:10 +0900 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-12-16 01:45:40 -0500 |
commit | 69668f1178435acff1a9295d0d27b70f9a7989fa (patch) | |
tree | 8fa1f1ae73983951eda4cc117ca53475b5523c8b /libs/hwui/GammaFontRenderer.cpp | |
parent | acfc22ef98d862000664757c800995d2670350a2 (diff) | |
download | frameworks_base-69668f1178435acff1a9295d0d27b70f9a7989fa.zip frameworks_base-69668f1178435acff1a9295d0d27b70f9a7989fa.tar.gz frameworks_base-69668f1178435acff1a9295d0d27b70f9a7989fa.tar.bz2 |
Fix memory leak in HWUI
std::unique_ptr::release just releases the ownership of the
managed object. To delete the object, std::unique_ptr::reset
function should be called.
Change-Id: If65f74085b1fc2be3a9fffc433326e0bcdb40ff3
Diffstat (limited to 'libs/hwui/GammaFontRenderer.cpp')
-rw-r--r-- | libs/hwui/GammaFontRenderer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/hwui/GammaFontRenderer.cpp b/libs/hwui/GammaFontRenderer.cpp index 0bcd83a..070c3d7 100644 --- a/libs/hwui/GammaFontRenderer.cpp +++ b/libs/hwui/GammaFontRenderer.cpp @@ -194,7 +194,7 @@ void Lookup3GammaFontRenderer::endPrecaching() { void Lookup3GammaFontRenderer::clear() { for (int i = 0; i < kGammaCount; i++) { - mRenderers[i].release(); + mRenderers[i].reset(nullptr); } } @@ -215,7 +215,7 @@ void Lookup3GammaFontRenderer::flush() { if (count <= 1 || min < 0) return; - mRenderers[min].release(); + mRenderers[min].reset(nullptr); // Also eliminate the caches for large glyphs, as they consume significant memory for (int i = 0; i < kGammaCount; ++i) { |