vcl/source/app/session.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
New commits: commit 8c87cfc252ed0bddc99ca1bc201234c3bb041a99 Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Dec 10 13:37:46 2015 +0100 Remove listeners upon dispose Change-Id: I9cee05fe75ba87da98ee3d4616099583fa03470d diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx index cca093b..96d243e 100644 --- a/vcl/source/app/session.cxx +++ b/vcl/source/app/session.cxx @@ -82,6 +82,8 @@ class VCLSession: virtual void SAL_CALL saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException, std::exception ) override; virtual sal_Bool SAL_CALL cancelShutdown() throw( RuntimeException, std::exception ) override; + void SAL_CALL disposing() override; + void callSaveRequested( bool bShutdown, bool bCancelable ); void callShutdownCancelled(); void callInteractionGranted( bool bGranted ); @@ -327,6 +329,22 @@ sal_Bool SAL_CALL VCLSession::cancelShutdown() throw( RuntimeException, std::exc return m_xSession && m_xSession->cancelShutdown(); } +void VCLSession::disposing() { + std::list<Listener> list; + { + osl::MutexGuard g(m_aMutex); + list.swap(m_aListeners); + } + css::lang::EventObject src(static_cast<OWeakObject *>(this)); + for (auto const & i: list) { + try { + i.m_xListener->disposing(src); + } catch (css::uno::RuntimeException & e) { + SAL_WARN("vcl.app", "ignoring RuntimeException " << e.Message); + } + } +} + // service implementation OUString SAL_CALL vcl_session_getImplementationName() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits