diff options
authorMiklos Vajna <>2019-08-12 17:57:25 +0200
committerXisco FaulĂ­ <>2019-08-14 12:07:54 +0200
commitad372e603547d54ab28271d89adc45250368a248 (patch)
parent36353add4180e8643f3adcb24c2a50881a3570ae (diff)
tdf#126808 vcl: fix crash due to leaking the frame's buffer vdev
This vdev is used to do vcl-level double-buffering, which is off by default, but e.g. listboxes/comboboxes use it to avoid flicker with Windows GDI. The root cause was introduced in commit ea5e83abcfa1406c401b8a1ec91efda65373b74b (tdf#92982 vcl: stop creating/disposing the paint buffer in PaintHelper, 2015-07-30), which removed the explicit mpBuffer.disposeAndClear() in the PaintHelper dtor, but forgot to explicitly dispose it elsewhere. This is now a much more visible problem since commit d4714b0fdb81e6e561ae526cc517ecc9a40a603e (tdf#101978 vcl combobox/listbox floating window: avoid flicker, 2019-06-17) as the infrastructure is used for all list/comboboxes. Fix the problem by explicitly disposing the vdev before deleting the frame data, so the underlying GDI resource is released, even if we have a reference cycle. Change-Id: Ia217bbd78780a214308e497044e73e378ee8ecd6 Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Jenkins (cherry picked from commit e71093c0bc52426647a9d3a41ac0643bbc6cb0c6) Reviewed-on: Reviewed-by: Xisco FaulĂ­ <>
1 files changed, 1 insertions, 0 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 8df50b57da1f..f2a42cf8edca 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -557,6 +557,7 @@ void Window::dispose()
assert (mpWindowImpl->mpFrameData->mnFocusId == nullptr);
assert (mpWindowImpl->mpFrameData->mnMouseMoveId == nullptr);
+ mpWindowImpl->mpFrameData->mpBuffer.disposeAndClear();
delete mpWindowImpl->mpFrameData;
mpWindowImpl->mpFrameData = nullptr;