summaryrefslogtreecommitdiff
path: root/cppuhelper/source/weak.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cppuhelper/source/weak.cxx')
-rw-r--r--cppuhelper/source/weak.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index ed1f77208249..85cf3f626482 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -111,6 +111,9 @@ void SAL_CALL OWeakConnectionPoint::dispose() throw(css::uno::RuntimeException)
std::vector<Reference<XReference>> aCopy;
{ // only hold the mutex while we access the field
MutexGuard aGuard(getWeakMutex());
+ // OWeakObject is not the only owner of this, so clear m_pObject
+ // so that queryAdapted() won't use it now that it's dead
+ m_pObject = nullptr;
// other code is going to call removeReference while we are doing this, so we need a
// copy, but since we are disposing and going away, we can just take the original data
aCopy.swap(m_aReferences);