From e3cf16e6fbf8d39cad8762f002b6db1d4f61ed36 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 07:03:24 +0200 Subject: Merging upstream version 4:24.2.3. Signed-off-by: Daniel Baumann --- accessibility/source/standard/vclxaccessibletoolbox.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'accessibility') diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index acb1d25471..c9f4546c12 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -630,9 +630,14 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleChild( sal if ( pItemWindow ) { Reference< XAccessible> xParent = xChild; - rtl::Reference xChild2( new OToolBoxWindowItem(0,::comphelper::getProcessComponentContext(),pItemWindow->GetAccessible(),xParent) ); - pItemWindow->SetAccessible(xChild2); - xChild->SetChild( xChild2 ); + auto const xInnerAcc(pItemWindow->GetAccessible()); + if (xInnerAcc) // else child is being disposed - avoid crashing + { + rtl::Reference xChild2(new OToolBoxWindowItem(0, + ::comphelper::getProcessComponentContext(), xInnerAcc, xParent)); + pItemWindow->SetAccessible(xChild2); + xChild->SetChild( xChild2 ); + } } if ( nHighlightItemId > ToolBoxItemId(0) && nItemId == nHighlightItemId ) xChild->SetFocus( true ); -- cgit v1.2.3