diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-28 15:41:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-28 22:10:26 +0200 |
commit | a69987dfd496413792d9bef5cb071615dd7ab375 (patch) | |
tree | e730b59cd55d5282b3a153db21942050b35e7f7c /sfx2 | |
parent | 36cec4b92e8be9f47467539967672ba8906096e1 (diff) |
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.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/notify/globalevents.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
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() |