summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-06-22 11:31:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-06-22 11:33:58 +0100
commit2822d1891b551a58c691cac37c11d3b9c2255755 (patch)
tree98124335264fad847ed13695200e1bf2f27bce69 /extensions
parent8488b3ba00e23e8ae6e089f450965c93c7a13d26 (diff)
valgrind: use after free
sal/osl/unx/conditn.cxx:90: pthread_cond_destroy failed: Device or resource busy sal/osl/unx/conditn.cxx:92: pthread_mutex_destroy failed: Device or resource busy "Desktop disposed before terminating it" seen under valgrind with CppunitTest_sccomp_lpsolver Change-Id: I643cf114b902c38a6a54487fd78c55d84ed78cfc
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/update/check/updatecheckjob.cxx16
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)