Kaydet (Commit) 6ccc70a8 authored tarafından Noel Grandin's avatar Noel Grandin

use unique_ptr in desktop::IpcThread

Change-Id: I7f67b4c9a157d7a1a5992174397c061b14c8a674
Reviewed-on: https://gerrit.libreoffice.org/65952
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a236da0c
......@@ -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())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment