sfx2/source/appl/linksrc.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 6dc7efa8067d4bd3a1e75eb85aabaf25485c389c Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Nov 6 18:35:20 2023 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Nov 8 20:00:32 2023 +0100 lok: fix crash on DDE Link modify 1. Open document with editable DDE Link section in 2 views 2. View A selects content containing section and copies that 3. View A is closed 4. View B tries to modify section Result: crash Avoid destroying SwTransferDdeLink in SwTransferable::~SwTransferable() what happens while calling RemoveDDELinkFormat in SwTransferDdeLink::DataChanged by keeping reference to it while iterating in SvLinkSource::NotifyDataChanged() Change-Id: Iba53a4c139f9d508d2f64bcc94b479761b84bf2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159008 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx index 131992c51040..3a1af228f6a4 100644 --- a/sfx2/source/appl/linksrc.cxx +++ b/sfx2/source/appl/linksrc.cxx @@ -287,7 +287,8 @@ void SvLinkSource::NotifyDataChanged() if( ( p->nAdviseModes & ADVISEMODE_NODATA ) || GetData( aVal, p->aDataMimeType, true ) ) { - p->xSink->DataChanged( p->aDataMimeType, aVal ); + tools::SvRef<sfx2::SvBaseLink> xLink(p->xSink); + xLink->DataChanged( p->aDataMimeType, aVal ); if ( !aIter.IsValidCurrValue( p ) ) continue;