summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-04-07 21:54:15 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-04-07 21:54:15 +0500
commit336bdbfe2bb23ab4d28511c660494c850cb5b0a7 (patch)
tree7e4f8f07952a349172851b93ee031581b1c30dc6
parentReapply "Release the mutex when calling the OLE method" (diff)
downloadcore-336bdbfe2bb23ab4d28511c660494c850cb5b0a7.tar.gz
core-336bdbfe2bb23ab4d28511c660494c850cb5b0a7.zip
Reapply "Pass m_pOleComponent to lambda by copy"
This reverts commit 77fe60bbac09b0b4ea0cf930f2260fa4b6496a3d.
-rw-r--r--embeddedobj/source/msole/oleembed.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index b946fed792c8..657d27710ca3 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -620,8 +620,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