[Resources] house keeping in TypeList

Symptom: Type was freed but still may be access
Root Cause: TypeList not cleared
Solution: clear the TypeList
Project: AOSP
Note: None
Test: Yes

Change-Id: I00225165a30d15a299b7a483ea393b4447d2a3fc
This commit is contained in:
Sean Lu
2017-06-26 18:19:28 +08:00
parent 91464bfe68
commit 83df8423e9

View File

@@ -3203,13 +3203,14 @@ struct ResTable::PackageGroup
clearBagCache();
const size_t numTypes = types.size();
for (size_t i = 0; i < numTypes; i++) {
const TypeList& typeList = types[i];
TypeList& typeList = types.editItemAt(i);
const size_t numInnerTypes = typeList.size();
for (size_t j = 0; j < numInnerTypes; j++) {
if (typeList[j]->package->owner == owner) {
delete typeList[j];
}
}
typeList.clear();
}
const size_t N = packages.size();