From f70a7e34953438dd70573dbb6fd3dd34a1bce831 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Tue, 9 Nov 2010 16:37:03 -0800 Subject: Fix possible crash when texture is NULL in the drop shadow cache. Change-Id: I2142c55dbcfebcdf013a7f4ae04b266a60f5ce8a --- libs/hwui/TextDropShadowCache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libs/hwui') diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp index 9d54277..2f7c7be 100644 --- a/libs/hwui/TextDropShadowCache.cpp +++ b/libs/hwui/TextDropShadowCache.cpp @@ -74,10 +74,10 @@ void TextDropShadowCache::setMaxSize(uint32_t maxSize) { /////////////////////////////////////////////////////////////////////////////// void TextDropShadowCache::operator()(ShadowText& text, ShadowTexture*& texture) { - const uint32_t size = texture->width * texture->height; - mSize -= size; - if (texture) { + const uint32_t size = texture->width * texture->height; + mSize -= size; + glDeleteTextures(1, &texture->id); delete texture; } -- cgit v1.1