summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/app.cxx23
-rw-r--r--desktop/source/deployment/inc/lockfile.hxx3
-rw-r--r--desktop/source/deployment/misc/lockfile.cxx9
3 files changed, 31 insertions, 4 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 44821e57b0b6..54405148d471 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -577,6 +577,7 @@ Desktop::Desktop()
: m_bCleanedExtensionCache( false )
, m_bServicesRegistered( false )
, m_aBootstrapError( BE_OK )
+, m_pLockfile( NULL )
{
RTL_LOGFILE_TRACE( "desktop (cd100003) ::Desktop::Desktop" );
}
@@ -673,7 +674,11 @@ void Desktop::DeInit()
::comphelper::setProcessServiceFactory( NULL );
// clear lockfile
- m_pLockfile.reset();
+ if (m_pLockfile != NULL)
+ {
+ delete m_pLockfile;
+ m_pLockfile = NULL;
+ }
OfficeIPCThread::DisableOfficeIPCThread();
if( pSignalHandler )
@@ -734,7 +739,12 @@ sal_Bool Desktop::QueryExit()
{
}
- m_pLockfile.reset();
+ if (m_pLockfile != NULL)
+ {
+ delete m_pLockfile;
+ m_pLockfile = NULL;
+ }
+
}
return bExit;
@@ -1300,7 +1310,11 @@ sal_uInt16 Desktop::Exception(sal_uInt16 nError)
default:
{
- m_pLockfile.reset();
+ if (m_pLockfile != NULL)
+ {
+ delete m_pLockfile;
+ m_pLockfile = NULL;
+ }
if( bRestart )
{
@@ -1454,7 +1468,8 @@ 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.reset( new Lockfile );
+ delete m_pLockfile;
+ m_pLockfile = new Lockfile;
#ifndef ANDROID
if ( !rCmdLineArgs.IsHeadless() && !rCmdLineArgs.IsInvisible() &&
!rCmdLineArgs.IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning ))
diff --git a/desktop/source/deployment/inc/lockfile.hxx b/desktop/source/deployment/inc/lockfile.hxx
index 79b88960d623..391dd3dccaba 100644
--- a/desktop/source/deployment/inc/lockfile.hxx
+++ b/desktop/source/deployment/inc/lockfile.hxx
@@ -74,6 +74,9 @@ 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);
diff --git a/desktop/source/deployment/misc/lockfile.cxx b/desktop/source/deployment/misc/lockfile.cxx
index fd9291fecc72..a06907731008 100644
--- a/desktop/source/deployment/misc/lockfile.cxx
+++ b/desktop/source/deployment/misc/lockfile.cxx
@@ -208,6 +208,15 @@ 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