summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-02-10 14:40:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-02-10 15:58:39 +0100
commit627cf7e91a741f55c6519bc33451b5aab9a68267 (patch)
tree5d5c137d8644755a8769f7c0fa045460a56a61d7 /extensions
parented0101dfaa3666422aa39dcc8c91aae6c4c36eae (diff)
Do not use this in ctor
Change-Id: If2177d309626ef599c7c15f6195151dc0d0a8e30
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/update/check/updatecheckjob.cxx25
1 files changed, 10 insertions, 15 deletions
diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx
index cd52e1f02063..0ba47146b27d 100644
--- a/extensions/source/update/check/updatecheckjob.cxx
+++ b/extensions/source/update/check/updatecheckjob.cxx
@@ -68,7 +68,11 @@ class UpdateCheckJob :
public:
- UpdateCheckJob(const uno::Reference<uno::XComponentContext>& xContext);
+ UpdateCheckJob(
+ css::uno::Reference<css::uno::XComponentContext> const & context,
+ css::uno::Reference<css::frame::XDesktop2> const & desktop):
+ m_xContext(context), m_xDesktop(desktop)
+ {}
static uno::Sequence< OUString > getServiceNames();
static OUString getImplName();
@@ -150,19 +154,6 @@ void InitUpdateCheckJobThread::setTerminating() {
m_aCondition.set();
}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-UpdateCheckJob::UpdateCheckJob( const uno::Reference<uno::XComponentContext>& xContext ) :
- m_xContext(xContext)
-{
- m_xDesktop.set( frame::Desktop::create(xContext) );
- m_xDesktop->addTerminateListener( this );
-}
-
-//------------------------------------------------------------------------------
-
UpdateCheckJob::~UpdateCheckJob()
{
}
@@ -330,7 +321,11 @@ void SAL_CALL UpdateCheckJob::notifyTermination( lang::EventObject const & )
static uno::Reference<uno::XInterface> SAL_CALL
createJobInstance(const uno::Reference<uno::XComponentContext>& xContext)
{
- return *new UpdateCheckJob(xContext);
+ css::uno::Reference<css::frame::XDesktop2> desktop(
+ css::frame::Desktop::create(xContext));
+ rtl::Reference<UpdateCheckJob> job(new UpdateCheckJob(xContext, desktop));
+ desktop->addTerminateListener(job.get());
+ return static_cast<cppu::OWeakObject *>(job.get());
}
//------------------------------------------------------------------------------