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.
diff --git a/rsAllocation.cpp b/rsAllocation.cpp
index 6770611..75b4462 100644
--- a/rsAllocation.cpp
+++ b/rsAllocation.cpp
@@ -52,6 +52,8 @@
Allocation::~Allocation()
{
+ free(mPtr);
+ mPtr = NULL;
}
void Allocation::setCpuWritable(bool)
diff --git a/rsContext.cpp b/rsContext.cpp
index abe7b4a..40e3c4a 100644
--- a/rsContext.cpp
+++ b/rsContext.cpp
@@ -350,6 +350,7 @@
rsc->deinitEGL();
pthread_mutex_unlock(&gInitMutex);
+ rsc->mObjDestroy.mNeedToEmpty = true;
rsc->objDestroyOOBRun();
LOGV("RS Thread exited");
return NULL;
@@ -421,6 +422,7 @@
mIO.shutdown();
int status = pthread_join(mThreadId, &res);
+ mObjDestroy.mNeedToEmpty = true;
objDestroyOOBRun();
// Global structure cleanup.
@@ -431,6 +433,7 @@
if (!gThreadTLSKeyCount) {
pthread_key_delete(gThreadTLSKey);
}
+ mDev = NULL;
}
pthread_mutex_unlock(&gInitMutex);
diff --git a/rsObjectBase.cpp b/rsObjectBase.cpp
index 0008ea4..1b442ba 100644
--- a/rsObjectBase.cpp
+++ b/rsObjectBase.cpp
@@ -39,6 +39,7 @@
rsAssert(!mUserRefCount);
rsAssert(!mSysRefCount);
remove();
+ delete[] mName;
}
void ObjectBase::dumpLOGV(const char *op) const
diff --git a/rsSimpleMesh.cpp b/rsSimpleMesh.cpp
index b082fd7..434a35f 100644
--- a/rsSimpleMesh.cpp
+++ b/rsSimpleMesh.cpp
@@ -99,6 +99,8 @@
SimpleMeshContext::~SimpleMeshContext()
{
+ delete[] mVertexTypes;
+ delete[] mVertexBuffers;
}
diff --git a/rsType.cpp b/rsType.cpp
index ddaa2f0..0eb4111 100644
--- a/rsType.cpp
+++ b/rsType.cpp
@@ -57,6 +57,7 @@
TypeState::~TypeState()
{
+ delete[] mLODs;
}
size_t Type::getOffsetForFace(uint32_t face) const