summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-09-25 18:12:46 +0200
committerMichael Stahl <mstahl@redhat.com>2014-09-25 20:58:51 +0200
commit021307d659984e937b18b9eb760d8d8d8b91da54 (patch)
treeed43ddcd44555d983acf9b05aa13a235821b8c41 /vcl/source/app
parent3cf9e1156d96b911632e0246271a49b9b9d819c6 (diff)
vcl: avoid crashes from Timer Queues on shutdown
The timer callback SalTimerProc can be called after DeInitVCL has deleted the SalInstance, and crash. Avoid that by calling WinSalTimer::Stop() and also using the INVALID_HANDLE_VALUE parameter which waits until the timer callback is done executing. Change-Id: Ia4cf2cf9dc48904d077e0a691e14107256c50ded
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/timer.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx
index 1f9870b2b436..703f7e81f03d 100644
--- a/vcl/source/app/timer.cxx
+++ b/vcl/source/app/timer.cxx
@@ -43,6 +43,12 @@ void Timer::ImplDeInitTimer()
ImplSVData* pSVData = ImplGetSVData();
ImplTimerData* pTimerData = pSVData->mpFirstTimerData;
+ // on WNT the timer queue thread needs killing
+ if (pSVData->mpSalTimer)
+ {
+ pSVData->mpSalTimer->Stop();
+ }
+
if ( pTimerData )
{
do
@@ -60,9 +66,10 @@ void Timer::ImplDeInitTimer()
pSVData->mpFirstTimerData = NULL;
pSVData->mnTimerPeriod = 0;
- delete pSVData->mpSalTimer;
- pSVData->mpSalTimer = NULL;
}
+
+ delete pSVData->mpSalTimer;
+ pSVData->mpSalTimer = 0;
}
static void ImplStartTimer( ImplSVData* pSVData, sal_uLong nMS )