summaryrefslogtreecommitdiff
path: root/vcl/win/app/salinst.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-04-11 23:49:12 +0200
committerMichael Stahl <mstahl@redhat.com>2016-04-18 11:23:56 +0000
commit8a0e6b25219e59b12034348b8b264117059755ec (patch)
tree2dc90d9cf21dfd2c81c86d077f59e38737cbe0c5 /vcl/win/app/salinst.cxx
parent8bf82dd3979871cc1284570fcb2b3dcaa442a17e (diff)
tdf#96887 vcl: stop using periodic timers on WNT
Every time the periodic timer fires, it does a PostMessage() to the main thread. The main thread will only process the first message and discard the rest anyway, but with a short enough timer and other threads hogging the SolarMutex it's possible that the message queue overflows and other PostMessage calls fail with ERROR_NOT_ENOUGH_QUOTA. Try to avoid the problem by having the WinSalTimer always be a one-shot timer; when it fires and the main thread processes the posted message, it is restarted with the new due time. This requires creating a new TimerQueueTimer because ChangeTimerQueueTimer only works on periodic timers. Change-Id: I816bd3fa5fbfbea4f26be8ff680a1c916618d3f9 Reviewed-on: https://gerrit.libreoffice.org/24024 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'vcl/win/app/salinst.cxx')
-rw-r--r--vcl/win/app/salinst.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index dd687d813b2b..bd5b49e1d219 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -672,6 +672,10 @@ LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, i
ImplSalStartTimer( (sal_uLong) lParam, FALSE );
rDef = FALSE;
break;
+ case SAL_MSG_STOPTIMER:
+ ImplSalStopTimer();
+ rDef = FALSE;
+ break;
case SAL_MSG_CREATEFRAME:
nRet = (LRESULT)ImplSalCreateFrame( GetSalData()->mpFirstInstance, (HWND)lParam, (SalFrameStyleFlags)wParam );
rDef = FALSE;