sc/source/ui/view/cellsh2.cxx |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit f2a41fa9e819a177c83377e21d91a208a97664d4
Author:     Pranam Lashkari <[email protected]>
AuthorDate: Wed Sep 17 21:26:17 2025 +0200
Commit:     Caolán McNamara <[email protected]>
CommitDate: Fri Sep 26 21:49:17 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 <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191542
    Tested-by: Caolán McNamara <[email protected]>

diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 51c5feea769c..9015239f0175 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -901,10 +901,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
                     // cell range picker
                     vcl::Window* pWin = GetViewData().GetActiveWin();
                     weld::Window* pParentWin = pWin ? pWin->GetFrameWeld() : 
nullptr;
-                    auto xDlg
-                        = std::make_shared<ScValidationDlg>(pParentWin, 
&aArgSet, pTabViewShell);
-
-                    auto aRegisterThatDlgExists
+                    auto xDlg = std::make_shared<ScValidationDlg>(pParentWin, 
&aArgSet, pTabViewShell);
+                    std::shared_ptr<ScValidationRegisteredDlg> 
pRegisterThatDlgExists
                         = 
std::make_shared<ScValidationRegisteredDlg>(pParentWin, xDlg);
 
                     struct lcl_auxData
@@ -923,11 +921,14 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
                         ScValidErrorStyle eErrStyle;
                         OUString aErrTitle;
                         OUString aErrText;
+                        std::shared_ptr<ScValidationRegisteredDlg> 
aRegisterThatDlgExists;
                     };
 
-                    std::shared_ptr<lcl_auxData> pAuxData = 
std::make_shared<lcl_auxData>(lcl_auxData{
-                        aCursorPos, eMode, eOper, aExpr1, aExpr2, bBlank, 
nListType, bShowHelp,
-                        aHelpTitle, aHelpText, bShowError, eErrStyle, 
aErrTitle, aErrText});
+                    std::shared_ptr<lcl_auxData> pAuxData = 
std::make_shared<lcl_auxData>(
+                        lcl_auxData{ aCursorPos, eMode, eOper, aExpr1, aExpr2, 
bBlank, nListType,
+                                     bShowHelp, aHelpTitle, aHelpText, 
bShowError, eErrStyle,
+                                     aErrTitle, aErrText, 
pRegisterThatDlgExists });
+
                     SfxTabDialogController::runAsync(
                         xDlg,
                         [&rDoc, pAuxData, nSlotId, xDlg, 
pTabViewShell](sal_Int32 nResult)

Reply via email to