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

New commits:
commit 28245b7f8738d8e44f54f7427149524006280c44
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 09:23:05 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>

diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 4296b341a4cd..96edd44d5114 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -918,7 +918,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
                     {
@@ -937,11 +938,13 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
                         OUString aErrTitle;
                         OUString aErrText;
                         bool bCaseSensitive;
+                        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, bCaseSensitive});
+                    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, bCaseSensitive, 
pRegisterThatDlgExists });
 
                     auto xRequest = std::make_shared<SfxRequest>(rReq);
                     rReq.Ignore(); // the 'old' request is not relevant any 
more

Reply via email to