Properly clear textures for Hardware Bitmaps

Test: manual  (Description in the bug)
bug:34858530
Change-Id: I13eb89077c43ca28436509a7af5b7c11374446c4
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index 1aeb8d6..63a6a2c 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -46,7 +46,7 @@
 }
 
 TextureCache::~TextureCache() {
-    mCache.clear();
+    this->clear();
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -214,6 +214,10 @@
 
 void TextureCache::clear() {
     mCache.clear();
+    for(auto& iter: mHardwareTextures) {
+        iter.second->deleteTexture();
+    }
+    mHardwareTextures.clear();
     TEXTURE_LOGD("TextureCache:clear(), mSize = %d", mSize);
 }