From 057b25c04ea1032c20d99fc3eda88680cd0b9e54 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 31 May 2021 10:57:33 +0200 Subject: [PATCH] crashtesting fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit when doing soffice --convert-to ods tdf96952-1.xls after commit 5c79032077d387053c62829d62518695f68555c1 Date: Tue May 25 09:32:58 2021 +0200 fix leaks in loading xmlscript Change-Id: I55c1e95a09db937604f62a5b33e56349512ff8ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116435 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- xmlscript/source/xmldlg_imexp/imp_share.hxx | 2 ++ xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index 99a52b58dcb1..2cc574c01b93 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -531,6 +531,8 @@ public: class BulletinBoardElement : public ControlElement { + // we are the owner of this, so have to keep a reference to it + rtl::Reference mxDialogImport; public: virtual css::uno::Reference< css::xml::input::XElement > SAL_CALL startChildElement( diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index da2fd2d2c412..66a69a2b5518 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -1725,7 +1725,8 @@ BulletinBoardElement::BulletinBoardElement( OUString const & rLocalName, Reference< xml::input::XAttributes > const & xAttributes, ElementBase * pParent, DialogImport * pImport ) - : ControlElement( rLocalName, xAttributes, pParent, pImport ) + : ControlElement( rLocalName, xAttributes, pParent, pImport ), + mxDialogImport(pImport) { OUString aValue( _xAttributes->getValueByUidName( m_pImport->XMLNS_DIALOGS_UID, "left" ) ); if (!aValue.isEmpty())