From 84035ff6f50dfb999d26ba476d5cb7619fa9cc57 Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Sun, 9 Jan 2011 16:09:51 -0800 Subject: [PATCH] Fix cleanup race condition where objects might may not be cleaned up correctly. Change-Id: Ia48e06c3d050b6b39b39f8fdc9f0eb89b92fe1bf --- libs/rs/rsContext.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index c437d72fb0707..6a065b2a29907 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -539,6 +539,7 @@ void Context::destroyWorkerThreadResources() { } ObjectBase::zeroAllUserRef(this); LOGV("destroyWorkerThreadResources 2"); + mExit = true; } void * Context::helperThreadProc(void *vrsc) { @@ -713,6 +714,9 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) { Context::~Context() { LOGV("Context::~Context"); + + mIO.mToCore.flush(); + rsAssert(mExit); mExit = true; mPaused = false; void *res;