From 45ed509f71aeef52cb86cc3d88aa2bcf86334bb7 Mon Sep 17 00:00:00 2001 From: Juergen Funk Date: Wed, 6 May 2015 14:12:15 +0200 Subject: Hidden exception in "SalTimerProc" when exit swriter (WIN) Only found the exception with the Debugger, when exit the swriter. The appliction stop the SalTimer, but the own message (SAL_MSG_TIMER_CALLBACK) is in the message-queue and restart the timer again. After that, the SalData would be delete and then in SalTimerProc use the SalData, then exception. Change-Id: I8e02a38d4e741cfd31de605cb5b172b28a0909fb Reviewed-on: https://gerrit.libreoffice.org/15649 Reviewed-by: Michael Stahl Tested-by: Michael Stahl --- vcl/win/source/app/saltimer.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vcl/win/source/app/saltimer.cxx b/vcl/win/source/app/saltimer.cxx index 18f666c66dfa..c6f04be986fe 100644 --- a/vcl/win/source/app/saltimer.cxx +++ b/vcl/win/source/app/saltimer.cxx @@ -39,6 +39,13 @@ void ImplSalStopTimer(SalData* pSalData) HANDLE hTimer = pSalData->mnTimerId; pSalData->mnTimerId = 0; DeleteTimerQueueTimer(NULL, hTimer, INVALID_HANDLE_VALUE); + MSG aMsg; + while (PeekMessageW(&aMsg, 0, SAL_MSG_TIMER_CALLBACK, SAL_MSG_TIMER_CALLBACK, PM_REMOVE)) + { + // just remove all the SAL_MSG_TIMER_CALLBACKs + // when the application end, this SAL_MSG_TIMER_CALLBACK start the timer again + // and then crashed in "SalTimerProc" when the object "SalData" was deleted + } } void ImplSalStartTimer( sal_uLong nMS, bool bMutex ) -- cgit v1.2.3