1894e94
From d57887eaad534ca51fc4975918fab66b2f93633d Mon Sep 17 00:00:00 2001
1894e94
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
1894e94
Date: Tue, 6 Dec 2011 16:26:05 +0000
1894e94
Subject: [PATCH] Resolves: rhbz#759647 ::dispose clears mpPresTimer before
1894e94
 releaseTimer called
1894e94
1894e94
---
1894e94
 slideshow/source/engine/slideshowimpl.cxx |    8 ++++++--
1894e94
 1 files changed, 6 insertions(+), 2 deletions(-)
1894e94
1894e94
diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx
1894e94
index 5be3b62..4277280 100644
1894e94
--- a/slideshow/source/engine/slideshowimpl.cxx
1894e94
+++ b/slideshow/source/engine/slideshowimpl.cxx
1894e94
@@ -2025,10 +2025,14 @@ sal_Bool SlideShowImpl::update( double & nNextTimeout )
1894e94
         //    that have zero delay.  While the timer is stopped these events
1894e94
         //    are processed in the same run.
1894e94
         {
1894e94
+            //Get a shared-ptr that outlives the scope-guard which will
1894e94
+            //ensure that the pointed-to-item exists in the case of a
1894e94
+            //::dispose clearing mpPresTimer
1894e94
+            boost::shared_ptr<canvas::tools::ElapsedTime> xTimer(mpPresTimer);
1894e94
             comphelper::ScopeGuard scopeGuard(
1894e94
                 boost::bind( &canvas::tools::ElapsedTime::releaseTimer,
1894e94
-                             boost::cref(mpPresTimer) ) );
1894e94
-            mpPresTimer->holdTimer();
1894e94
+                             boost::cref(xTimer) ) );
1894e94
+            xTimer->holdTimer();
1894e94
 
1894e94
             // process queues
1894e94
             maEventQueue.process();
1894e94
-- 
1894e94
1.7.6.4
1894e94