summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kenny Root <kroot@android.com> 2012-11-14 10:45:51 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2012-11-14 10:45:51 -0800
commit9a9f874c150feef05ebf7652abcb8f1b73397c51 (patch)
tree2a765db770399858dad96b9be35a9e693843a6a0
parentdbdcebdb2dfd6850880f85f0ef4f67e10073b0c1 (diff)
parente2a2fe4ef3695baf3c7dca1637373ebd968a4704 (diff)
am e2a2fe4e: am be37b5fa: Merge "Free resources in correct order in ResStringPool::uninit"
* commit 'e2a2fe4ef3695baf3c7dca1637373ebd968a4704': Free resources in correct order in ResStringPool::uninit
-rw-r--r--libs/androidfw/ResourceTypes.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 46ac8860a639..fc2cd9ead498 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -506,10 +506,6 @@ status_t ResStringPool::getError() const
void ResStringPool::uninit()
{
mError = NO_INIT;
- if (mOwnedData) {
- free(mOwnedData);
- mOwnedData = NULL;
- }
if (mHeader != NULL && mCache != NULL) {
for (size_t x = 0; x < mHeader->stringCount; x++) {
if (mCache[x] != NULL) {
@@ -520,6 +516,10 @@ void ResStringPool::uninit()
free(mCache);
mCache = NULL;
}
+ if (mOwnedData) {
+ free(mOwnedData);
+ mOwnedData = NULL;
+ }
}
/**