Fix layers lifecycle issues
Bug: 16118540
Fix an issue where we could have a reference to a Layer after
the GL context was destroyed
Change-Id: I7bfd909d735ca6b942ebe188fc10099422eb6d95
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index f5d4f8b..57279b7 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -250,8 +250,7 @@
stopDrawing();
if (mEglManager.hasEglContext()) {
requireGlContext();
- TreeInfo info(TreeInfo::MODE_DESTROY_RESOURCES, mRenderThread.renderState());
- mRootRenderNode->prepareTree(info);
+ mRootRenderNode->destroyHardwareResources();
Caches::getInstance().flush(Caches::kFlushMode_Layers);
}
}