Fix some leaks. This fixes the major malloc memory leak in allApps. Still tracking some much more minor issues.
diff --git a/rsContext.cpp b/rsContext.cpp
index eb388af..961ec0b 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);