From 031037f49120cb5527e390b89b52da845b517a66 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 24 Sep 2018 12:54:28 -0700 Subject: [PATCH] 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 --- ReactCommon/fabric/uimanager/Scheduler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ReactCommon/fabric/uimanager/Scheduler.cpp b/ReactCommon/fabric/uimanager/Scheduler.cpp index 6828b0aeb..056222fdf 100644 --- a/ReactCommon/fabric/uimanager/Scheduler.cpp +++ b/ReactCommon/fabric/uimanager/Scheduler.cpp @@ -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(ShadowNode::emptySharedShadowNodeSharedList())); shadowTree->setDelegate(nullptr); shadowTreeRegistry_.erase(iterator); }