[Libreoffice-commits] .: Branch 'libreoffice-3-5' - slideshow/source

Thorsten Behrens thorsten at kemper.freedesktop.org
Wed Dec 7 01:59:48 PST 2011


 slideshow/source/engine/slideshowimpl.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 3881092eba0b42f16a48a54690232aedf411fd8d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Dec 6 16:26:05 2011 +0000

    Resolves: rhbz#759647 ::dispose clears mpPresTimer before releaseTimer called

diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx
index 5be3b62..4277280 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -2025,10 +2025,14 @@ sal_Bool SlideShowImpl::update( double & nNextTimeout )
         //    that have zero delay.  While the timer is stopped these events
         //    are processed in the same run.
         {
+            //Get a shared-ptr that outlives the scope-guard which will
+            //ensure that the pointed-to-item exists in the case of a
+            //::dispose clearing mpPresTimer
+            boost::shared_ptr<canvas::tools::ElapsedTime> xTimer(mpPresTimer);
             comphelper::ScopeGuard scopeGuard(
                 boost::bind( &canvas::tools::ElapsedTime::releaseTimer,
-                             boost::cref(mpPresTimer) ) );
-            mpPresTimer->holdTimer();
+                             boost::cref(xTimer) ) );
+            xTimer->holdTimer();
 
             // process queues
             maEventQueue.process();


More information about the Libreoffice-commits mailing list