[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - basctl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 10 15:12:42 UTC 2020


 basctl/source/basicide/baside2.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit df6d4c50943a039acf75593a3e09376cef795d07
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jul 6 16:23:51 2020 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri Jul 10 17:12:18 2020 +0200

    Resolves: tdf#134551 ModulWindow deleted when last module removed
    
    leaving a dangling reference to m_aName. Hold a reference until
    ExecuteCommand is finished.
    
    Change-Id: I82ac5cc73427a945c78b9317dee9edf6129bb975
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98083
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98505
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 5cb16f8f1f58..4a9fc67c94d0 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1009,8 +1009,13 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
         case SID_BASICIDE_DELETECURRENT:
         {
             if (QueryDelModule(m_aName, GetFrameWeld()))
+            {
+                // tdf#134551 don't delete the window if last module is removed until this block
+                // is complete
+                VclPtr<ModulWindow> xKeepRef(this);
                 if (m_aDocument.removeModule(m_aLibName, m_aName))
                     MarkDocumentModified(m_aDocument);
+            }
         }
         break;
         case FID_SEARCH_OFF:
@@ -1050,7 +1055,6 @@ void ModulWindow::ExecuteGlobal (SfxRequest& rReq)
     }
 }
 
-
 void ModulWindow::GetState( SfxItemSet &rSet )
 {
     SfxWhichIter aIter(rSet);


More information about the Libreoffice-commits mailing list