diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-10-08 12:57:00 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-08 13:01:56 +0200 |
commit | d8a0ecc94bfbfc1d9c8403f0e894d3b7e40384f2 (patch) | |
tree | fb772e5756f0f74763a08fa27a11662ce69f19ef | |
parent | 62aa0f83fa64c560e56f0af8629d81f327d39b5e (diff) |
Do not terminate desktop from a Timer
<sberg> kendy, as you recently changed Timer handling on Windows: debugging why
quickstarter no longer works on Windows, I run into the phenomenon that
IdleTerminate::Timeout (sfx2/source/appl/shutdownicon.cxx) executes on the main
thread, and from within the m_xDesktop->terminate() call Timer::ImplDeInitTimer
is called which deletes the pTimerData corresponding to our IldeTerminate, so
that Timer::ImplTimerCallbackProc, after the return from
IdleTerminate::Timeout, will operate on a stale pTimerData and crash; could
that be related to those recent changes?
<kendy> sberg: I think mst told that we were previously never deleting the
timer, and that he did some changes there [...]
<mst__> sberg, IdleTerminate needs a different implementation
<mst__> sberg, does it work to do this via PostUserEvent, as
"Application::Quit()" does?
<sberg> mst__, do you think calling terminate from a Timer did work in the past?
[...]
<mst__> sberg, perhaps it did before [a recent] commit but i would guess it
would be more by accident than by design
Change-Id: I23b14ba59a963cc2209a261a1459d532a88acdc0
-rw-r--r-- | sfx2/source/appl/shutdownicon.cxx | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index d98b122c633d..6bd93b18e088 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -63,7 +63,6 @@ #include <unistd.h> #include <errno.h> #endif -#include <vcl/timer.hxx> #include <sfx2/sfxresid.hxx> @@ -183,22 +182,6 @@ bool LoadModule() } -class IdleTerminate : Timer -{ - ::com::sun::star::uno::Reference< XDesktop2 > m_xDesktop; -public: - IdleTerminate (::com::sun::star::uno::Reference< XDesktop2 > xDesktop) - { - m_xDesktop = xDesktop; - Start(); - } - virtual void Timeout() SAL_OVERRIDE - { - m_xDesktop->terminate(); - delete this; - } -}; - void ShutdownIcon::initSystray() { if (m_bInitialized) @@ -564,7 +547,7 @@ void ShutdownIcon::terminateDesktop() // terminate desktop only if no tasks exist ::com::sun::star::uno::Reference< XIndexAccess > xTasks ( xDesktop->getFrames(), UNO_QUERY ); if( xTasks.is() && xTasks->getCount() < 1 ) - new IdleTerminate( xDesktop ); + Application::Quit(); // remove the instance pointer ShutdownIcon::pShutdownIcon = 0; |