The create/destroy for RenderEngine needs to happen on the same thread.
The threaded variant of RE was running the destructor on whatever
thread deleted the wrapper class and not on the thread where RE was
actually running. This means that any GPU state that is specific
to the thread was not being correctly cleaned up.
Test: librenderengine_test
Bug: 175348740
Change-Id: I88e3129bf8af451e2a97155286941d312ea096da
diff --git a/libs/renderengine/threaded/RenderEngineThreaded.cpp b/libs/renderengine/threaded/RenderEngineThreaded.cpp
index c9f6296..c87a836 100644
--- a/libs/renderengine/threaded/RenderEngineThreaded.cpp
+++ b/libs/renderengine/threaded/RenderEngineThreaded.cpp
@@ -90,6 +90,9 @@
return !mRunning || !mFunctionCalls.empty();
});
}
+
+ // we must release the RenderEngine on the thread that created it
+ mRenderEngine.reset();
}
void RenderEngineThreaded::waitUntilInitialized() const {