diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-02-07 21:07:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-08 11:23:19 +0100 |
commit | 87030862d4750b456f876dc48310d87ed48848f0 (patch) | |
tree | d7ff2dc74aea78648a762e9b5dfe71a192fccf1a /framework/source | |
parent | 5088e6d34b0ffba423f8633ee83673a9c1d40036 (diff) |
replace some more copy/clear with swap
Change-Id: I6501dd59682d2605e9b9856c2deaa02a873ce641
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88239
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/services/desktop.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index 94f41f9fa1af..8b20e591a24d 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -338,12 +338,13 @@ sal_Bool SAL_CALL Desktop::terminate() xPipeTerminator->notifyTermination( aEvent ); // we need a copy here as the notifyTermination call might cause a removeTerminateListener call - std::vector< css::uno::Reference<css::frame::XTerminateListener> > xComponentDllListeners = m_xComponentDllListeners; + std::vector< css::uno::Reference<css::frame::XTerminateListener> > xComponentDllListeners; + xComponentDllListeners.swap(m_xComponentDllListeners); for (auto& xListener : xComponentDllListeners) { xListener->notifyTermination(aEvent); } - m_xComponentDllListeners.clear(); + xComponentDllListeners.clear(); // Must be really the last listener to be called. // Because it shutdown the whole process asynchronous ! @@ -1104,13 +1105,13 @@ void SAL_CALL Desktop::disposing() m_xSWThreadManager.clear(); // we need a copy because the disposing might call the removeEventListener method - std::vector< css::uno::Reference<css::frame::XTerminateListener> > xComponentDllListeners = m_xComponentDllListeners; + std::vector< css::uno::Reference<css::frame::XTerminateListener> > xComponentDllListeners; + xComponentDllListeners.swap(m_xComponentDllListeners); for (auto& xListener: xComponentDllListeners) { xListener->disposing(aEvent); } xComponentDllListeners.clear(); - m_xComponentDllListeners.clear(); m_xSfxTerminator.clear(); m_xCommandOptions.reset(); |