Free resources in correct order in ResStringPool::uninit

mOwnedData contains the mHeader data structure

Change-Id: I0ae9ba3a0d18fc3f368c629501fadebce8807198
This commit is contained in:
Chris Dearman
2012-10-08 12:22:02 -07:00
parent 07b4339b2a
commit a1d82ff393

View File

@@ -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;
}
}
/**