diff --git a/comphelper/source/misc/SelectionMultiplex.cxx b/comphelper/source/misc/SelectionMultiplex.cxx index 438eaa80d718..37e4e30037b3 100644 --- a/comphelper/source/misc/SelectionMultiplex.cxx +++ b/comphelper/source/misc/SelectionMultiplex.cxx @@ -101,7 +101,10 @@ void OSelectionChangeMultiplexer::dispose() { Reference< XSelectionChangeListener> xPreventDelete(this); if(m_xSet.is()) + { m_xSet->removeSelectionChangeListener(xPreventDelete); + m_xSet.clear(); + } } osl_atomic_decrement(&m_refCount); } diff --git a/comphelper/source/misc/configuration.cxx b/comphelper/source/misc/configuration.cxx index f4ee4e0298bb..2c99e64e46d9 100644 --- a/comphelper/source/misc/configuration.cxx +++ b/comphelper/source/misc/configuration.cxx @@ -295,6 +295,7 @@ void comphelper::ConfigurationListener::dispose() listener->dispose(); } maListeners.clear(); + mxConfig.clear(); mbDisposed = true; } diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx index 84c8054ecbb8..465cc5185834 100644 --- a/comphelper/source/misc/instancelocker.cxx +++ b/comphelper/source/misc/instancelocker.cxx @@ -216,6 +216,7 @@ void OLockListener::Dispose() return; auto xInstance = std::move(m_xInstance); + auto xApproval = std::move(m_xApproval); auto nMode = m_nMode; m_bDisposed = true; aGuard.unlock();