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

loplugin:useuniqueptr in AsynchronLink

Change-Id: I911bb1f8ca98e368f8275083936a8eb9013f462c
üst d72a2899
......@@ -24,6 +24,7 @@
#include <tools/solar.h>
#include <tools/link.hxx>
#include <osl/mutex.hxx>
#include <memory>
class Idle;
class Timer;
......@@ -35,11 +36,11 @@ class SVT_DLLPUBLIC AsynchronLink
{
Link<void*,void> _aLink;
ImplSVEvent* _nEventId;
Idle* _pIdle;
std::unique_ptr<Idle> _pIdle;
bool _bInCall;
bool* _pDeleted;
void* _pArg;
::osl::Mutex* _pMutex;
std::unique_ptr<::osl::Mutex> _pMutex;
DECL_DLLPRIVATE_LINK( HandleCall_Idle, Timer*, void );
DECL_DLLPRIVATE_LINK( HandleCall_PostUserEvent, void*, void );
......
......@@ -30,7 +30,7 @@ namespace svtools {
void AsynchronLink::CreateMutex()
{
if( !_pMutex ) _pMutex = new osl::Mutex;
if( !_pMutex ) _pMutex.reset( new osl::Mutex );
}
void AsynchronLink::Call( void* pObj, bool bAllowDoubles )
......@@ -55,9 +55,9 @@ AsynchronLink::~AsynchronLink()
{
Application::RemoveUserEvent( _nEventId );
}
delete _pIdle;
_pIdle.reset();
if( _pDeleted ) *_pDeleted = true;
delete _pMutex;
_pMutex.reset();
}
IMPL_LINK_NOARG( AsynchronLink, HandleCall_Idle, Timer*, void )
......
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