diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-07 13:24:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-08 08:29:08 +0100 |
commit | 6ccc70a8a5cf3bcf9504f3a0b7dd30969e4d7ae0 (patch) | |
tree | c6f3ea21154226143fa64cc5db35c61122718c72 /desktop | |
parent | a236da0c740e79aed9213005c6a106b4fe2cb293 (diff) |
use unique_ptr in desktop::IpcThread
Change-Id: I7f67b4c9a157d7a1a5992174397c061b14c8a674
Reviewed-on: https://gerrit.libreoffice.org/65952
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 08c0d4b83fa7..59450974e1b0 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -292,9 +292,9 @@ static void ImplPostForeignAppEvent( ApplicationEvent* pEvent ) Application::PostUserEvent( LINK( nullptr, ProcessEventsClass_Impl, CallEvent ), pEvent ); } -static void ImplPostProcessDocumentsEvent( ProcessDocumentsRequest* pEvent ) +static void ImplPostProcessDocumentsEvent( std::unique_ptr<ProcessDocumentsRequest> pEvent ) { - Application::PostUserEvent( LINK( nullptr, ProcessEventsClass_Impl, ProcessDocumentsEvent ), pEvent ); + Application::PostUserEvent( LINK( nullptr, ProcessEventsClass_Impl, ProcessDocumentsEvent ), pEvent.release() ); } oslSignalAction SalMainPipeExchangeSignal_impl(SAL_UNUSED_PARAMETER void* /*pData*/, oslSignalInfo* pInfo) @@ -976,8 +976,8 @@ bool IpcThread::process(OString const & arguments, bool * waitProcessed) { ImplPostForeignAppEvent( pAppEvent ); } - ProcessDocumentsRequest* pRequest = new ProcessDocumentsRequest( - aCmdLineArgs->getCwdUrl()); + std::unique_ptr<ProcessDocumentsRequest> pRequest(new ProcessDocumentsRequest( + aCmdLineArgs->getCwdUrl())); m_handler->cProcessed.reset(); pRequest->pcProcessed = &m_handler->cProcessed; m_handler->mbSuccess = false; @@ -1108,13 +1108,12 @@ bool IpcThread::process(OString const & arguments, bool * waitProcessed) { pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::EFactory::DRAW ); } - ImplPostProcessDocumentsEvent( pRequest ); + ImplPostProcessDocumentsEvent( std::move(pRequest) ); } else { // delete not used request again - delete pRequest; - pRequest = nullptr; + pRequest.reset(); } if (aCmdLineArgs->IsEmpty()) { |