summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/linksrc.cxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2023-11-06 18:35:20 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-11-09 09:40:40 +0100
commitef5828fb45e2b46a36b73260232dede3d98e22a4 (patch)
tree450121434ee03ad895457292a3640b50f89a62d8 /sfx2/source/appl/linksrc.cxx
parent4f505ba25335b1b279ab8164825c3d051cd74757 (diff)
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/+/159040 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sfx2/source/appl/linksrc.cxx')
-rw-r--r--sfx2/source/appl/linksrc.cxx3
1 files changed, 2 insertions, 1 deletions
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;