desktop/source/deployment/gui/dp_gui_service.cxx   |    2 +-
 desktop/source/deployment/gui/dp_gui_theextmgr.hxx |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 5f626a166ed8b7917c8acc40652a7dcc696fa137
Author:     Michael Weghorn <[email protected]>
AuthorDate: Tue Feb 24 09:43:56 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Feb 24 23:50:57 2026 +0100

    tdf#170805 extension mgr: Don't destroy dialog while still needed
    
        commit 5a6985c124c7a0ca246fbc920ab5e024d72a5e4a
        Author: Michael Weghorn <[email protected]>
        Date:   Sat Nov 8 09:42:17 2025 +0100
    
            tdf#169318 extension mgr: Deduplicate close logic
    
    extended TheExtensionManager::Close to also
    reset TheExtensionManager::m_xExtMgrDialog, i.e.
    delete the extension manager dialog.
    
    That is fine for the callers newly added in the
    above commit.
    
    However, for the preexisting case in
    ServiceImpl::startExecuteModal, the call to
    TheExtensionManager::checkUpdates
    a few lines above the call to
    TheExtensionManager::Close triggers a separate
    update thread that still wants to use the
    dialog after it gets closed, causing a crash.
    
    (Can be triggered e.g. by installing older
    version 6.3 of the LanguageTool extension [1],
    then "Help" -> "Check for Updates", closing
    that dialog, then clicking the "Updates for extensions
    available" button in the menu bar; requires a build
    with --enable-online-update enabled.)
    
    Don't destroy the dialog there, but only close
    the dialog itself, by calling weld::Dialog::response
    instead.
    
    Make the "destructive" TheExtensionManager::Close
    private.
    
    [1] https://extensions.libreoffice.org/en/extensions/show/languagetool
    
    Change-Id: I370b357fe4db435489366afbf1b3003770d6a209
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200151
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx 
b/desktop/source/deployment/gui/dp_gui_service.cxx
index b8a03667e91f..bc5e09de57ab 100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -251,7 +251,7 @@ void ServiceImpl::startExecuteModal(
         {
             myExtMgr->checkUpdates();
             if ( bCloseDialog )
-                myExtMgr->Close();
+                rDialog.getDialog()->response(RET_CANCEL);
             else
                 myExtMgr->ToTop();
         }
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx 
b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index 0b1b50070e21..281c87ad165d 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
@@ -85,7 +85,6 @@ public:
     void SetText( const OUString &rTitle );
     void Show();
     void ToTop();
-    void Close();
     bool isVisible();
 
 
@@ -114,6 +113,9 @@ public:
 
     // XModifyListener
     virtual void SAL_CALL modified( css::lang::EventObject const & evt ) 
override;
+
+private:
+    void Close();
 };
 
 } // namespace dp_gui

Reply via email to