summaryrefslogtreecommitdiff
path: root/libs/hwui/RenderNode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/RenderNode.cpp')
-rw-r--r--libs/hwui/RenderNode.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 89105ea19fbd..3cf625fc08eb 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -211,7 +211,8 @@ void RenderNode::prepareTreeImpl(TreeInfo& info) {
// This will also release the hardware layer if we have one as
// isRenderable() will return false, thus causing pushLayerUpdate
// to recycle the hardware layer
- setStagingDisplayList(NULL);
+ LOG_ALWAYS_FATAL_IF(mStagingDisplayListData || (mDisplayListData && !mNeedsDisplayListDataSync),
+ "View.destroyHardwareResources wasn't called!");
break;
}
@@ -260,7 +261,11 @@ void RenderNode::pushStagingDisplayListChanges(TreeInfo& info) {
mNeedsDisplayListDataSync = false;
// Do a push pass on the old tree to handle freeing DisplayListData
// that are no longer used
- TreeInfo oldTreeInfo(TreeInfo::MODE_MAYBE_DETACHING, info);
+ TreeInfo::TraversalMode mode = TreeInfo::MODE_MAYBE_DETACHING;
+ if (CC_UNLIKELY(info.mode == TreeInfo::MODE_DESTROY_RESOURCES)) {
+ mode = TreeInfo::MODE_DESTROY_RESOURCES;
+ }
+ TreeInfo oldTreeInfo(mode, info);
prepareSubTree(oldTreeInfo, mDisplayListData);
delete mDisplayListData;
mDisplayListData = mStagingDisplayListData;