summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-02 11:19:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-02 12:29:42 +0200
commit558dface96fbc5f487b16cfa1bf3c3ea20776331 (patch)
treeb38deb8ca531ec3c73ece78f78442c5713607d91
parente594c5e408593622bb70d54ef03ec5ca09a2d721 (diff)
fix potential use-after-free in SwClipboardChangeListener
we think we're seeing this in COOL Change-Id: I29a287b032158076a99a836d98113d1623ebef99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118277 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/uibase/uiview/uivwimp.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx
index 336ce8de1975..6ad240701960 100644
--- a/sw/source/uibase/uiview/uivwimp.cxx
+++ b/sw/source/uibase/uiview/uivwimp.cxx
@@ -287,6 +287,8 @@ SwClipboardChangeListener::~SwClipboardChangeListener()
void SAL_CALL SwClipboardChangeListener::disposing( const EventObject& /*rEventObject*/ )
{
+ SolarMutexGuard aGuard;
+ pView = nullptr; // so we don't touch the view if changedContents somehow fires afterwards
}
void SAL_CALL SwClipboardChangeListener::changedContents( const css::datatransfer::clipboard::ClipboardEvent& rEventObject )