diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-03-19 12:14:34 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-03-20 04:41:36 +0100 |
commit | ec0e9bee23b5950c02abcbe27564b8188f9f789e (patch) | |
tree | 13b42f98404251876642073ee921e59058f64161 /embeddedobj | |
parent | 53c5d570cab036b23f4969b858a648c8f0c24f93 (diff) |
Pass m_pOleComponent to lambda by copy
Both m_pOleComponent and the copy are rtl::Reference, so the copy
will ensure the lifetime of the object.
See https://gerrit.libreoffice.org/c/core/+/164986/2#message-5dd187741df3242f47d1037a1f9c9b0fd9bb1f8e
Change-Id: I092281ce41786682b269ba048f102877117391f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165013
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/msole/oleembed.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx index 821cbae9b1c4..a7a2bf661d70 100644 --- a/embeddedobj/source/msole/oleembed.cxx +++ b/embeddedobj/source/msole/oleembed.cxx @@ -623,8 +623,10 @@ uno::Sequence< sal_Int32 > SAL_CALL OleEmbeddedObject::getReachableStates() // the list of states can only be guessed based on standard verbs, // since there is no way to detect what additional verbs do + // Pass m_pOleComponent to the lambda by copy, to make sure it doesn't depend on possible + // destruction of 'this', while the lock is unset return GetReachableStatesList_Impl( - ExecUnlocked([this] { return m_pOleComponent->GetVerbList(); }, aGuard)); + ExecUnlocked([p = m_pOleComponent] { return p->GetVerbList(); }, aGuard)); } else #endif |