Fabric: Cleaning up Shadow Tree on surface unregistering

Summary: As it mentioned in the comment, we have to commit an empty tree as part of cleaning up Surface.

Reviewed By: mdvacca

Differential Revision: D9931320

fbshipit-source-id: 04e780bafdb917adeb89f2edef2dc0348b2a4d4a
This commit is contained in:
Valentin Shergin 2018-09-24 12:54:28 -07:00 committed by Facebook Github Bot
parent 55e168980f
commit 031037f491
1 changed files with 2 additions and 0 deletions

View File

@ -54,6 +54,8 @@ void Scheduler::unregisterRootTag(Tag rootTag) {
const auto &iterator = shadowTreeRegistry_.find(rootTag);
const auto &shadowTree = iterator->second;
assert(shadowTree);
// As part of stopping the Surface, we have to commit an empty tree.
shadowTree->complete(std::const_pointer_cast<SharedShadowNodeList>(ShadowNode::emptySharedShadowNodeSharedList()));
shadowTree->setDelegate(nullptr);
shadowTreeRegistry_.erase(iterator);
}