[Libreoffice-commits] core.git: sfx2/source

Stephan Bergmann sbergman at redhat.com
Wed Oct 8 04:02:18 PDT 2014


 sfx2/source/appl/shutdownicon.cxx |   19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

New commits:
commit d8a0ecc94bfbfc1d9c8403f0e894d3b7e40384f2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Oct 8 12:57:00 2014 +0200

    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

diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index d98b122..6bd93b1 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;


More information about the Libreoffice-commits mailing list