Merge change Ib7a6c434 into eclair

* changes:
  Fix some leaks.  This fixes the major malloc memory leak in allApps.  Still tracking some much more minor issues.
This commit is contained in:
Android (Google) Code Review
2009-11-02 17:31:15 -05:00
5 changed files with 9 additions and 0 deletions

View File

@@ -52,6 +52,8 @@ Allocation::Allocation(Context *rsc, const Type *type) : ObjectBase(rsc)
Allocation::~Allocation()
{
free(mPtr);
mPtr = NULL;
}
void Allocation::setCpuWritable(bool)

View File

@@ -350,6 +350,7 @@ void * Context::threadProc(void *vrsc)
rsc->deinitEGL();
pthread_mutex_unlock(&gInitMutex);
rsc->mObjDestroy.mNeedToEmpty = true;
rsc->objDestroyOOBRun();
LOGV("RS Thread exited");
return NULL;
@@ -421,6 +422,7 @@ Context::~Context()
mIO.shutdown();
int status = pthread_join(mThreadId, &res);
mObjDestroy.mNeedToEmpty = true;
objDestroyOOBRun();
// Global structure cleanup.
@@ -431,6 +433,7 @@ Context::~Context()
if (!gThreadTLSKeyCount) {
pthread_key_delete(gThreadTLSKey);
}
mDev = NULL;
}
pthread_mutex_unlock(&gInitMutex);

View File

@@ -39,6 +39,7 @@ ObjectBase::~ObjectBase()
rsAssert(!mUserRefCount);
rsAssert(!mSysRefCount);
remove();
delete[] mName;
}
void ObjectBase::dumpLOGV(const char *op) const

View File

@@ -99,6 +99,8 @@ SimpleMeshContext::SimpleMeshContext()
SimpleMeshContext::~SimpleMeshContext()
{
delete[] mVertexTypes;
delete[] mVertexBuffers;
}

View File

@@ -57,6 +57,7 @@ TypeState::TypeState()
TypeState::~TypeState()
{
delete[] mLODs;
}
size_t Type::getOffsetForFace(uint32_t face) const