From 38f9bb33dd6ef4870a71440cf6a86caf5576eaef Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 29 Sep 2017 10:05:37 +0200 Subject: prevent crash while disposing ListControl when children are disposed Change-Id: I9e69d0b29ab41428d87bf37edeebe652f7e9c297 Reviewed-on: https://gerrit.libreoffice.org/43251 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard --- vcl/source/control/listctrl.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vcl/source/control/listctrl.cxx b/vcl/source/control/listctrl.cxx index 66c743fd83a2..1c42b0565fb9 100644 --- a/vcl/source/control/listctrl.cxx +++ b/vcl/source/control/listctrl.cxx @@ -45,6 +45,12 @@ void ListControl::dispose() void ListControl::RecalcAll() { + // avoid recalculating while we are disposing + // children. This just leads to complex invalid memory + // access patterns that are not fixable. + if (IsDisposed()) + return; + sal_Int32 nTotalHeight = 0; for (const auto& item : maEntries) { -- cgit