From 822aca756ee16e901d8ecd2728da16a2738fdc26 Mon Sep 17 00:00:00 2001 From: Harini Malothu <185761277+HariniMalothu17@users.noreply.github.com> Date: Wed, 25 Feb 2026 14:35:57 +0530 Subject: [PATCH] =?UTF-8?q?Revert=20"[0.81]Fix=20crash=20in=20ABIViewManag?= =?UTF-8?q?er::RemoveAllChildren=20during=20shutdown=20=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4621507c06472667fd2fd9b0186e9f3119f6f513. --- vnext/Microsoft.ReactNative/ABIViewManager.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) 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); }