diff options
author | Nancy Zheng <nzheng@google.com> | 2016-01-13 15:23:56 -0800 |
---|---|---|
committer | Nancy Zheng <nzheng@google.com> | 2016-01-13 15:23:56 -0800 |
commit | 74dfcf90f18d8d0e1128707a5986c4fa94d70350 (patch) | |
tree | e7dafb136a6bd65211a07c709f9b6f6c7c352714 /libs/hwui | |
parent | eebf168e43e4a455a74e949cc0d7e156b231a697 (diff) | |
download | frameworks_base-74dfcf90f18d8d0e1128707a5986c4fa94d70350.zip frameworks_base-74dfcf90f18d8d0e1128707a5986c4fa94d70350.tar.gz frameworks_base-74dfcf90f18d8d0e1128707a5986c4fa94d70350.tar.bz2 |
Pulling in https://android-review.googlesource.com/#/c/186482/1
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.
Bug: 26116596
Change-Id: If65f74085b1fc2be3a9fffc433326e0bcdb40ff3
Diffstat (limited to 'libs/hwui')
-rw-r--r-- | libs/hwui/Caches.cpp | 2 | ||||
-rw-r--r-- | libs/hwui/GammaFontRenderer.cpp | 4 | ||||
-rw-r--r-- | libs/hwui/Layer.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp index aa73d44..2763e89 100644 --- a/libs/hwui/Caches.cpp +++ b/libs/hwui/Caches.cpp @@ -117,7 +117,7 @@ void Caches::initStaticProperties() { void Caches::terminate() { if (!mInitialized) return; - mRegionMesh.release(); + mRegionMesh.reset(nullptr); fboCache.clear(); 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) { diff --git a/libs/hwui/Layer.cpp b/libs/hwui/Layer.cpp index e16865e..62eeb43 100644 --- a/libs/hwui/Layer.cpp +++ b/libs/hwui/Layer.cpp @@ -251,7 +251,7 @@ void Layer::defer(const OpenGLRenderer& rootRenderer) { void Layer::cancelDefer() { renderNode = nullptr; deferredUpdateScheduled = false; - deferredList.release(); + deferredList.reset(nullptr); } void Layer::flush() { |