sc/source/ui/view/cellsh2.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
New commits: commit ef7151c271d14f623759f87d30e452f2e6d66664 Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Wed Sep 17 21:26:17 2025 +0200 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Sep 18 14:09:30 2025 +0200 tdf#156263: fixes freeze after opening data validity dialog after making dialog async ScValidationRegisteredDlg was destroyed while dialog is still running causing undefined behaviour regression caused by 63b26e8e20f6a4eeb3117925b7a727f565e3a2dc Change-Id: Idef30f12b88c46cb30a01ffb12588bb11e279750 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191105 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191116 Tested-by: Jenkins diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 8ea98aa97635..75ec68e4f1ee 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -928,7 +928,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) vcl::Window* pWin = GetViewData().GetActiveWin(); weld::Window* pParentWin = pWin ? pWin->GetFrameWeld() : nullptr; auto xDlg = std::make_shared<ScValidationDlg>(pParentWin, &aArgSet, pTabViewShell); - ScValidationRegisteredDlg aRegisterThatDlgExists(pParentWin, xDlg); + std::shared_ptr<ScValidationRegisteredDlg> pRegisterThatDlgExists + = std::make_shared<ScValidationRegisteredDlg>(pParentWin, xDlg); struct lcl_auxData { @@ -947,11 +948,13 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) OUString aErrTitle; OUString aErrText; bool bCaseSensitive; + std::shared_ptr<ScValidationRegisteredDlg> aRegisterThatDlgExists; }; - std::shared_ptr<lcl_auxData> xAuxData = std::make_shared<lcl_auxData>(lcl_auxData{ - aCursorPos, eMode, eOper, aExpr1, aExpr2, bBlank, nListType, bShowHelp, - aHelpTitle, aHelpText, bShowError, eErrStyle, aErrTitle, aErrText, bCaseSensitive}); + std::shared_ptr<lcl_auxData> xAuxData = std::make_shared<lcl_auxData>( + lcl_auxData{ aCursorPos, eMode, eOper, aExpr1, aExpr2, bBlank, nListType, + bShowHelp, aHelpTitle, aHelpText, bShowError, eErrStyle, + aErrTitle, aErrText, bCaseSensitive, pRegisterThatDlgExists }); auto xRequest = std::make_shared<SfxRequest>(rReq); rReq.Ignore(); // the 'old' request is not relevant any more