From b7a6c4340a35b7cc4ceeeccf6cc01ed82c99a8ba Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Mon, 2 Nov 2009 14:25:10 -0800 Subject: Fix some leaks. This fixes the major malloc memory leak in allApps. Still tracking some much more minor issues. --- libs/rs/rsContext.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libs/rs/rsContext.cpp') diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index eb388af50034..961ec0b2709c 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); -- cgit v1.2.3-59-g8ed1b