summaryrefslogtreecommitdiff
path: root/vcl
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
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')
-rw-r--r--vcl/source/app/timer.cxx11
-rw-r--r--vcl/win/source/app/saltimer.cxx2
2 files changed, 10 insertions, 3 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 )
diff --git a/vcl/win/source/app/saltimer.cxx b/vcl/win/source/app/saltimer.cxx
index f54e2a3570c3..9191d5e5619a 100644
--- a/vcl/win/source/app/saltimer.cxx
+++ b/vcl/win/source/app/saltimer.cxx
@@ -38,7 +38,7 @@ void ImplSalStopTimer(SalData* pSalData)
{
HANDLE hTimer = pSalData->mnTimerId;
pSalData->mnTimerId = 0;
- DeleteTimerQueueTimer(NULL, hTimer, 0);
+ DeleteTimerQueueTimer(NULL, hTimer, INVALID_HANDLE_VALUE);
}
void ImplSalStartTimer( sal_uLong nMS, bool bMutex )