From d299dc45409503ec4500b07c517b25e06438c611 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 6 Jul 2020 16:23:51 +0100 Subject: Resolves: tdf#134551 ModulWindow deleted when last module removed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/+/98214 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- basctl/source/basicide/baside2.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'basctl') diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 46014b5e32db..f8964c96c3b8 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 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); -- cgit v1.2.3