summaryrefslogtreecommitdiff
path: root/vcl/win/app/saltimer.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-04-11 23:15:23 +0200
committerMichael Stahl <mstahl@redhat.com>2016-04-12 15:17:03 +0200
commit6f047b5866ee7c3f707a4f12ef9f95e7dbdb6e93 (patch)
tree341a7c333dfaadf0e9e240330e158f67bb2a5203 /vcl/win/app/saltimer.cxx
parent3bbd98301ad95a9aff74bd2ae08c1e2e04a0f10b (diff)
WNT: check result of PostMessage()
... so the next time something overflows the main thread's message queue it's easier to debug. Change-Id: I90a35e46f3b2cab190c7da5e53024ec549159ac6
Diffstat (limited to 'vcl/win/app/saltimer.cxx')
-rw-r--r--vcl/win/app/saltimer.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/vcl/win/app/saltimer.cxx b/vcl/win/app/saltimer.cxx
index c6f04be986fe..30aa816745c1 100644
--- a/vcl/win/app/saltimer.cxx
+++ b/vcl/win/app/saltimer.cxx
@@ -81,7 +81,10 @@ void WinSalTimer::Start( sal_uLong nMS )
if ( pSalData->mpFirstInstance )
{
if ( pSalData->mnAppThreadId != GetCurrentThreadId() )
- PostMessageW( pSalData->mpFirstInstance->mhComWnd, SAL_MSG_STARTTIMER, 0, (LPARAM)nMS );
+ {
+ BOOL const ret = PostMessageW(pSalData->mpFirstInstance->mhComWnd, SAL_MSG_STARTTIMER, 0, (LPARAM)nMS);
+ SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!");
+ }
else
SendMessageW( pSalData->mpFirstInstance->mhComWnd, SAL_MSG_STARTTIMER, 0, (LPARAM)nMS );
}
@@ -124,7 +127,11 @@ void CALLBACK SalTimerProc(PVOID, BOOLEAN)
// always post message when the timer fires, we will remove the ones
// that happened during execution of the callback later directly from
// the message queue
- PostMessageW(pSalData->mpFirstInstance->mhComWnd, SAL_MSG_TIMER_CALLBACK, 0, 0);
+ BOOL const ret = PostMessageW(pSalData->mpFirstInstance->mhComWnd, SAL_MSG_TIMER_CALLBACK, 0, 0);
+#if OSL_DEBUG_LEVEL > 0
+ if (0 == ret) // SEH prevents using SAL_WARN here?
+ fputs("ERROR: PostMessage() failed!", stderr);
+#endif
#if defined ( __MINGW32__ ) && !defined ( _WIN64 )
}