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