From 2c3b5e0691322bcd541e3259eeb05df641ef5751 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 6 Aug 2018 09:16:50 +0200 Subject: fix for crash in CppunitTest_services on windows after commit 9cceba9a928cf3b3447f293020be2fe76c035ed5 make DBG_TESTSOLARMUTEX available in assert builds bt looks like: #0 0x00007faf569074fd in ImplDbgTestSolarMutex() #1 0x00007faf56904df9 in vcl::EventPoster::~EventPoster() #2 0x00007faf4392b452 in AutoRecovery::~AutoRecovery() #3 0x00007faf4392b589 in AutoRecovery::~AutoRecovery() #4 0x00007faf5d03dfc8 in __run_exit_handlers() Change-Id: If72eece22db89b492d8e69d1abb496168e32cb9d Reviewed-on: https://gerrit.libreoffice.org/58636 Tested-by: Jenkins Reviewed-by: Noel Grandin --- framework/source/services/autorecovery.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'framework/source') diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 8247183340e9..f0ca35e9f894 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -391,7 +391,7 @@ private: Timer m_aTimer; /** @short make our dispatch asynchronous ... if required to do so! */ - vcl::EventPoster m_aAsyncDispatcher; + std::unique_ptr m_xAsyncDispatcher; /** @see DispatchParams */ @@ -1209,7 +1209,7 @@ AutoRecovery::AutoRecovery(const css::uno::Reference< css::uno::XComponentContex , m_nAutoSaveTimeIntervall (0 ) , m_eJob (AutoRecovery::E_NO_JOB ) , m_aTimer ( "Auto save timer" ) - , m_aAsyncDispatcher ( LINK( this, AutoRecovery, implts_asyncDispatch ) ) + , m_xAsyncDispatcher (new vcl::EventPoster( LINK( this, AutoRecovery, implts_asyncDispatch ) )) , m_eTimerType (E_DONT_START_TIMER ) , m_nIdPool (0 ) , m_lListener (cppu::WeakComponentImplHelperBase::rBHelper.rMutex) @@ -1241,6 +1241,8 @@ AutoRecovery::~AutoRecovery() void AutoRecovery::disposing() { implts_stopTimer(); + SolarMutexGuard g; + m_xAsyncDispatcher.reset(); } Any SAL_CALL AutoRecovery::queryInterface( const css::uno::Type& _rType ) @@ -1335,7 +1337,7 @@ void SAL_CALL AutoRecovery::dispatch(const css::util::URL& } /* SAFE */ if (bAsync) - m_aAsyncDispatcher.Post(); + m_xAsyncDispatcher->Post(); else implts_dispatch(aParams); } -- cgit