diff options
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/update/check/updatecheckjob.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx index ba41067d047a..5d48471f0869 100644 --- a/extensions/source/update/check/updatecheckjob.cxx +++ b/extensions/source/update/check/updatecheckjob.cxx @@ -106,9 +106,9 @@ private: std::unique_ptr< InitUpdateCheckJobThread > m_pInitThread; void handleExtensionUpdates( const uno::Sequence< beans::NamedValue > &rListProp ); + void terminateAndJoinThread(); }; - InitUpdateCheckJobThread::InitUpdateCheckJobThread( const uno::Reference< uno::XComponentContext > &xContext, const uno::Sequence< beans::NamedValue > &xParameters, @@ -155,7 +155,6 @@ UpdateCheckJob::~UpdateCheckJob() { } - uno::Sequence< OUString > UpdateCheckJob::getServiceNames() { @@ -281,6 +280,7 @@ void SAL_CALL UpdateCheckJob::disposing( lang::EventObject const & rEvt ) if ( shutDown && m_xDesktop.is() ) { + terminateAndJoinThread(); m_xDesktop->removeTerminateListener( this ); m_xDesktop.clear(); } @@ -293,19 +293,23 @@ void SAL_CALL UpdateCheckJob::queryTermination( lang::EventObject const & ) { } - -void SAL_CALL UpdateCheckJob::notifyTermination( lang::EventObject const & ) - throw ( uno::RuntimeException, std::exception ) +void UpdateCheckJob::terminateAndJoinThread() { if ( m_pInitThread.get() != nullptr ) { m_pInitThread->setTerminating(); m_pInitThread->join(); + m_pInitThread.reset(); } } -} // anonymous namespace +void SAL_CALL UpdateCheckJob::notifyTermination( lang::EventObject const & ) + throw ( uno::RuntimeException, std::exception ) +{ + terminateAndJoinThread(); +} +} // anonymous namespace static uno::Reference<uno::XInterface> SAL_CALL createJobInstance(const uno::Reference<uno::XComponentContext>& xContext) |