summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2009-12-14 10:44:48 +0100
committerVladimir Glazunov <vg@openoffice.org>2009-12-14 10:44:48 +0100
commit69b4957ba8e2ba6dd5faf91335cd4a45d3fb3664 (patch)
tree99f0ca3a77c30a13452eab734c95f21243138f10 /sfx2
parent58f82332952121102702fb400f6c62c99c5c277b (diff)
parenta8b42ddd66bba4b6f26a4d2d793051752989938e (diff)
CWS-TOOLING: integrate CWS qstartfix2_DEV300
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 995b8250e072..52805082de38 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