sfx2/source/notify/globalevents.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit a69987dfd496413792d9bef5cb071615dd7ab375 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Sep 28 15:41:28 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Sep 28 22:10:26 2021 +0200 fix deadlock on exit (attempt2) regression from commit 8122c82d90117fc0c4c8ea87aa7f771d5e92bf36 osl::Mutex->std::mutex in SfxGlobalEvents_Imp Change-Id: Ia7416520a3538dcb77d7a4573045122581730264 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122779 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sfx2/source/notify/globalevents.cxx b/sfx2/source/notify/globalevents.cxx index 71fdd8a70aae..aba0d718c7d0 100644 --- a/sfx2/source/notify/globalevents.cxx +++ b/sfx2/source/notify/globalevents.cxx @@ -246,13 +246,15 @@ void SfxGlobalEvents_Impl::dispose() { if (m_disposed) return; m_disposed = true; - auto tmp = std::move(m_xEvents); + auto tmpEvents = std::move(m_xEvents); + auto tmpModels = std::move(m_lModels); m_xJobExecutorListener.clear(); m_disposeListeners.swap(listeners); m_lModels.clear(); g.unlock(); - // clear events outside lock because it will trigger a call back into us - tmp.clear(); + // clear events&models outside lock because it will trigger a call back into us + tmpEvents.clear(); + tmpModels.clear(); g.lock(); m_aLegacyListeners.disposeAndClear(g, {static_cast<OWeakObject *>(this)}); g.lock(); // because disposeAndClear is going to want to unlock()