diff --git a/change/react-native-windows-e5b91d1c-aafb-48c2-84b7-0296657e2f1d.json b/change/react-native-windows-e5b91d1c-aafb-48c2-84b7-0296657e2f1d.json new file mode 100644 index 00000000000..ae0d15d9e79 --- /dev/null +++ b/change/react-native-windows-e5b91d1c-aafb-48c2-84b7-0296657e2f1d.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "Revert \"[0.81]Fix crash in ABIViewManager::RemoveAllChildren during shutdown …\"", + "packageName": "react-native-windows", + "email": "hmalothu@microsoft.com", + "dependentChangeType": "none" +} diff --git a/vnext/Microsoft.ReactNative/ABIViewManager.cpp b/vnext/Microsoft.ReactNative/ABIViewManager.cpp index 9b643ef6909..fcf8172894b 100644 --- a/vnext/Microsoft.ReactNative/ABIViewManager.cpp +++ b/vnext/Microsoft.ReactNative/ABIViewManager.cpp @@ -190,19 +190,8 @@ void ABIViewManager::AddView(const xaml::DependencyObject &parent, const xaml::D } void ABIViewManager::RemoveAllChildren(const xaml::DependencyObject &parent) { - if (!parent) { - return; - } - if (m_viewManagerWithChildren) { - auto fe = parent.try_as(); - if (fe) { - try { - m_viewManagerWithChildren.RemoveAllChildren(fe); - } catch (...) { - // External view manager may fail during shutdown if view is already disposed - } - } + m_viewManagerWithChildren.RemoveAllChildren(parent.as()); } else { Super::RemoveAllChildren(parent); }