Fix memory leak in ResTable
We were basically never cleaning any of the
cached bags... oops :S
Bug:16683269
Change-Id: Ic0a44218f660e16fbaac8df1d61ce6f1fdb0018b
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 3f014ef..0ee6e03 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -2939,7 +2939,7 @@
for (size_t i = 0; i < bags->size(); i++) {
TABLE_NOISY(printf("type=%d\n", i));
const TypeList& typeList = types[i];
- if (typeList.isEmpty()) {
+ if (!typeList.isEmpty()) {
bag_set** typeBags = bags->get(i);
TABLE_NOISY(printf("typeBags=%p\n", typeBags));
if (typeBags) {