summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-09-09 14:41:53 +0200
committerStephan Bergmann <sbergman@redhat.com>2011-09-09 17:46:37 +0200
commit1d38dbab29245e430792f7b3a4c14c94cd011504 (patch)
tree8a4d711e750675ec34e010be6e62a2313f1d6590 /desktop/source
parent21d97438e2944861e26e4984195f959a0cce1e41 (diff)
sb140: #i117084# do not leak Lockfile instance
plus improvements based on a14010cb8c485ee1d07530d34a00f03db3233e02 "valgrind: fix leak"
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/app.cxx22
-rw-r--r--desktop/source/app/lockfile.cxx9
-rw-r--r--desktop/source/app/lockfile.hxx3
3 files changed, 4 insertions, 30 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index efe2038a69ec..bf486472d25a 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -676,7 +676,6 @@ throw()
Desktop::Desktop()
: m_bServicesRegistered( false )
, m_aBootstrapError( BE_OK )
-, m_pLockfile( NULL )
{
RTL_LOGFILE_TRACE( "desktop (cd100003) ::Desktop::Desktop" );
}
@@ -797,11 +796,7 @@ void Desktop::DeInit()
::comphelper::setProcessServiceFactory( NULL );
// clear lockfile
- if (m_pLockfile != NULL)
- {
- delete m_pLockfile;
- m_pLockfile = NULL;
- }
+ m_pLockfile.reset();
OfficeIPCThread::DisableOfficeIPCThread();
if( pSignalHandler )
@@ -862,12 +857,7 @@ sal_Bool Desktop::QueryExit()
{
}
- if (m_pLockfile != NULL)
- {
- delete m_pLockfile;
- m_pLockfile = NULL;
- }
-
+ m_pLockfile.reset();
}
return bExit;
@@ -1482,11 +1472,7 @@ sal_uInt16 Desktop::Exception(sal_uInt16 nError)
default:
{
- if (m_pLockfile != NULL)
- {
- delete m_pLockfile;
- m_pLockfile = NULL;
- }
+ m_pLockfile.reset();
if( bRestart )
{
@@ -1633,7 +1619,7 @@ int Desktop::Main()
// check user installation directory for lockfile so we can be sure
// there is no other instance using our data files from a remote host
RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main -> Lockfile" );
- m_pLockfile = new Lockfile;
+ m_pLockfile.reset( new Lockfile );
if ( !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsInvisible() &&
!rCmdLineArgs.IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning ))
{
diff --git a/desktop/source/app/lockfile.cxx b/desktop/source/app/lockfile.cxx
index 72632bdb5e27..98ddb7f18cd8 100644
--- a/desktop/source/app/lockfile.cxx
+++ b/desktop/source/app/lockfile.cxx
@@ -210,15 +210,6 @@ namespace desktop {
aConfig.Flush( );
}
- void Lockfile::clean( void )
- {
- if ( m_bRemove )
- {
- File::remove( m_aLockname );
- m_bRemove = sal_False;
- }
- }
-
Lockfile::~Lockfile( void )
{
// unlock userdata by removing file
diff --git a/desktop/source/app/lockfile.hxx b/desktop/source/app/lockfile.hxx
index 5444714ec88c..75a61d62c87d 100644
--- a/desktop/source/app/lockfile.hxx
+++ b/desktop/source/app/lockfile.hxx
@@ -73,9 +73,6 @@ namespace desktop {
// found (iff gui) and returns false when we may not continue
sal_Bool check( fpExecWarning execWarning );
- // removes the lockfile. should only be called in exceptional situations
- void clean(void);
-
// removes the lockfile
~Lockfile(void);