Skip to content

Commit b766d3e

Browse files
HariniMalothu17Harini Malothu
andauthored
Revert "[0.81]Fix crash in ABIViewManager::RemoveAllChildren during shutdown" (#15695)
* Revert "[0.81]Fix crash in ABIViewManager::RemoveAllChildren during shutdown …" This reverts commit 4621507. * Change files --------- Co-authored-by: Harini Malothu <hmalothu@microsoft.com>
1 parent 21e795f commit b766d3e

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Revert \"[0.81]Fix crash in ABIViewManager::RemoveAllChildren during shutdown …\"",
4+
"packageName": "react-native-windows",
5+
"email": "hmalothu@microsoft.com",
6+
"dependentChangeType": "none"
7+
}

vnext/Microsoft.ReactNative/ABIViewManager.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,8 @@ void ABIViewManager::AddView(const xaml::DependencyObject &parent, const xaml::D
190190
}
191191

192192
void ABIViewManager::RemoveAllChildren(const xaml::DependencyObject &parent) {
193-
if (!parent) {
194-
return;
195-
}
196-
197193
if (m_viewManagerWithChildren) {
198-
auto fe = parent.try_as<xaml::FrameworkElement>();
199-
if (fe) {
200-
try {
201-
m_viewManagerWithChildren.RemoveAllChildren(fe);
202-
} catch (...) {
203-
// External view manager may fail during shutdown if view is already disposed
204-
}
205-
}
194+
m_viewManagerWithChildren.RemoveAllChildren(parent.as<xaml::FrameworkElement>());
206195
} else {
207196
Super::RemoveAllChildren(parent);
208197
}

0 commit comments

Comments
 (0)