summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-12-11 10:15:07 +0000
committerOliver Bolte <obo@openoffice.org>2009-12-11 10:15:07 +0000
commit1587c426fdf0b492f74a6575b3cbcf1e5b8332e1 (patch)
tree4251e6cfb1f43ca91a3e5c1fa6629ef06f560d10 /sfx2
parent5d54f34507205fdc88ca59d7d6c22464c6be06e7 (diff)
CWS-TOOLING: integrate CWS qstartfix2
2009-10-23 12:50:38 +0200 mmeeks r277141 : fix i#101245# 2009-10-23 12:50:22 +0200 mmeeks r277140 : Fix i#101245#
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/shutdownicon.cxx31
1 files changed, 26 insertions, 5 deletions
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 693af2d0c0..985af75b1f 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -69,6 +69,7 @@
#include <unistd.h>
#include <errno.h>
#endif
+#include <vcl/timer.hxx>
#include "sfxresid.hxx"
@@ -186,6 +187,23 @@ bool ShutdownIcon::LoadModule( osl::Module **pModule,
return true;
}
+class IdleUnloader : Timer
+{
+ ::osl::Module *m_pModule;
+public:
+ IdleUnloader (::osl::Module **pModule) :
+ m_pModule (*pModule)
+ {
+ *pModule = NULL;
+ Start();
+ }
+ virtual void Timeout()
+ {
+ delete m_pModule;
+ delete this;
+ }
+};
+
void ShutdownIcon::initSystray()
{
if (m_bInitialized)
@@ -201,15 +219,15 @@ void ShutdownIcon::deInitSystray()
{
if (!m_bInitialized)
return;
+
if (m_pDeInitSystray)
m_pDeInitSystray();
m_bVeto = false;
m_pInitSystray = 0;
m_pDeInitSystray = 0;
- if (m_pPlugin)
- delete m_pPlugin;
- m_pPlugin = 0;
+ new IdleUnloader (&m_pPlugin);
+
delete m_pFileDlg;
m_pFileDlg = NULL;
m_bInitialized = false;
@@ -233,6 +251,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) :
ShutdownIcon::~ShutdownIcon()
{
deInitSystray();
+ new IdleUnloader (&m_pPlugin);
}
// ---------------------------------------------------------------------------
@@ -853,9 +872,11 @@ void ShutdownIcon::SetAutostart( bool bActivate )
::osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl );
::osl::File::remove( aShortcutUrl );
#ifdef UNX
- ShutdownIcon *pIcon = getInstance();
- if( pIcon )
+ if (pShutdownIcon)
+ {
+ ShutdownIcon *pIcon = getInstance();
pIcon->deInitSystray();
+ }
#endif
}
#elif defined OS2