summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2010-11-25 16:25:55 +0000
committerMichael Meeks <michael.meeks@novell.com>2010-11-26 15:33:00 +0000
commit7a5769ad1e39025078de0065189142d2a9097061 (patch)
tree73d40a3b0229b6bc4938e8d44da38c5348b2082e /sfx2
parent4268d52db240eafee166a35f1b34d59836ea74f4 (diff)
fix crash in exiting via disabling lone quick-starter, terminate at idle
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/shutdownicon.cxx26
1 files changed, 21 insertions, 5 deletions
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index f08bbadcc300..efc41d040dc7 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -182,6 +182,9 @@ bool ShutdownIcon::LoadModule( osl::Module **pModule,
return true;
}
+// These two timeouts are necessary to avoid there being
+// plugin frames still on the stack, after unloading that
+// code, causing a crash during disabling / termination.
class IdleUnloader : Timer
{
::osl::Module *m_pModule;
@@ -199,6 +202,22 @@ public:
}
};
+class IdleTerminate : Timer
+{
+ Reference< XDesktop > m_xDesktop;
+public:
+ IdleTerminate (Reference< XDesktop > xDesktop)
+ {
+ m_xDesktop = xDesktop;
+ Start();
+ }
+ virtual void Timeout()
+ {
+ m_xDesktop->terminate();
+ delete this;
+ }
+};
+
void ShutdownIcon::initSystray()
{
if (m_bInitialized)
@@ -576,11 +595,8 @@ void ShutdownIcon::terminateDesktop()
if ( xSupplier.is() )
{
Reference< XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY );
- if( xTasks.is() )
- {
- if( xTasks->getCount() < 1 )
- xDesktop->terminate();
- }
+ if( xTasks.is() && xTasks->getCount() < 1 )
+ new IdleTerminate( xDesktop );
}
// remove the instance pointer