diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-08-17 19:41:53 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-08-20 09:35:51 +0200 |
commit | 35a254750392dcd738481f5d6e8719cee9fb41b3 (patch) | |
tree | 89f96f08a58667fa8d307558f342a687c118f40e /vcl/win/window/salframe.cxx | |
parent | 3e97b8a74b20d72d36ac65d3ef091cae79b8cdac (diff) |
tdf#118786 WIN allow nested SendMessage calls
This bug trips "assert( !pInst->mbNoYieldLock )".
There is already a special case, introduced in commit 4baec725e0dc
("WIN run main thread redirects ignoring SolarMutex"), to prevent
tripping the assert for a nested SendMessage call.
So this implements a general solution for nested SendMessage calls.
We just have to prevent yielding in a call from an other thread,
as the sending thread still owns the SolarMutex.
This way we can also drop the special handling in
WinSalFrame::ReleaseFrameGraphicsDC.
Change-Id: I7024b081b26f3545af12a3a3a038fe5e5671af3c
Reviewed-on: https://gerrit.libreoffice.org/59275
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/win/window/salframe.cxx')
-rw-r--r-- | vcl/win/window/salframe.cxx | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 7d37bdcc652c..334b518cb340 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -917,13 +917,8 @@ bool WinSalFrame::ReleaseFrameGraphicsDC( WinSalGraphics* pGraphics ) if ( pGraphics->getDefPal() ) SelectPalette( hDC, pGraphics->getDefPal(), TRUE ); pGraphics->DeInitGraphics(); - // we don't want to run the WinProc in the main thread directly - // so we don't hit the mbNoYieldLock assert - if ( !pSalData->mpInstance->IsMainThread() ) - SendMessageW( pSalData->mpInstance->mhComWnd, SAL_MSG_RELEASEDC, - reinterpret_cast<WPARAM>(mhWnd), reinterpret_cast<LPARAM>(hDC) ); - else - ReleaseDC( mhWnd, hDC ); + SendMessageW( pSalData->mpInstance->mhComWnd, SAL_MSG_RELEASEDC, + reinterpret_cast<WPARAM>(mhWnd), reinterpret_cast<LPARAM>(hDC) ); if ( pGraphics == mpThreadGraphics ) pSalData->mnCacheDCInUse--; pGraphics->setHDC(nullptr); |