diff options
author | Jason Sams <rjsams@android.com> | 2009-11-02 15:22:34 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-11-02 15:22:34 -0800 |
commit | 43b5a566442f2f15cbc04d2ac2c7e2169d10d8bd (patch) | |
tree | d0d5fc560e12eb62fcc3772fa06c473fbf30b7e5 /libs | |
parent | cb93e01f4c474177a2a3d9d02f5b21329a1aed5e (diff) | |
parent | 766df995e30caa054cc25068e55f160c765590eb (diff) | |
download | frameworks_base-43b5a566442f2f15cbc04d2ac2c7e2169d10d8bd.zip frameworks_base-43b5a566442f2f15cbc04d2ac2c7e2169d10d8bd.tar.gz frameworks_base-43b5a566442f2f15cbc04d2ac2c7e2169d10d8bd.tar.bz2 |
am 766df995: am d31b0e44: am 3bbb5e9a: Merge change Ib7a6c434 into eclair
Merge commit '766df995e30caa054cc25068e55f160c765590eb'
* commit '766df995e30caa054cc25068e55f160c765590eb':
Fix some leaks. This fixes the major malloc memory leak in allApps. Still tracking some much more minor issues.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/rs/rsAllocation.cpp | 2 | ||||
-rw-r--r-- | libs/rs/rsContext.cpp | 3 | ||||
-rw-r--r-- | libs/rs/rsObjectBase.cpp | 1 | ||||
-rw-r--r-- | libs/rs/rsSimpleMesh.cpp | 2 | ||||
-rw-r--r-- | libs/rs/rsType.cpp | 1 |
5 files changed, 9 insertions, 0 deletions
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp index 6770611..75b4462 100644 --- a/libs/rs/rsAllocation.cpp +++ b/libs/rs/rsAllocation.cpp @@ -52,6 +52,8 @@ Allocation::Allocation(Context *rsc, const Type *type) : ObjectBase(rsc) Allocation::~Allocation() { + free(mPtr); + mPtr = NULL; } void Allocation::setCpuWritable(bool) diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index abe7b4a..40e3c4a 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -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); diff --git a/libs/rs/rsObjectBase.cpp b/libs/rs/rsObjectBase.cpp index 0008ea4..1b442ba 100644 --- a/libs/rs/rsObjectBase.cpp +++ b/libs/rs/rsObjectBase.cpp @@ -39,6 +39,7 @@ ObjectBase::~ObjectBase() rsAssert(!mUserRefCount); rsAssert(!mSysRefCount); remove(); + delete[] mName; } void ObjectBase::dumpLOGV(const char *op) const diff --git a/libs/rs/rsSimpleMesh.cpp b/libs/rs/rsSimpleMesh.cpp index b082fd7..434a35f 100644 --- a/libs/rs/rsSimpleMesh.cpp +++ b/libs/rs/rsSimpleMesh.cpp @@ -99,6 +99,8 @@ SimpleMeshContext::SimpleMeshContext() SimpleMeshContext::~SimpleMeshContext() { + delete[] mVertexTypes; + delete[] mVertexBuffers; } diff --git a/libs/rs/rsType.cpp b/libs/rs/rsType.cpp index ddaa2f0..0eb4111 100644 --- a/libs/rs/rsType.cpp +++ b/libs/rs/rsType.cpp @@ -57,6 +57,7 @@ TypeState::TypeState() TypeState::~TypeState() { + delete[] mLODs; } size_t Type::getOffsetForFace(uint32_t face) const |