sfx2/source/appl/linksrc.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ef5828fb45e2b46a36b73260232dede3d98e22a4
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: Thu Nov 9 09:40:40 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/+/159040
    Tested-by: Jenkins
    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;

Reply via email to