toolkit/source/helper/unowrapper.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit 76698a4a1c8e514962cc54fd9ddc73e39fce7177 Author: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> AuthorDate: Thu Jun 2 15:51:47 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Jun 15 06:29:54 2022 +0200 Fix leak with stock widgets in a dialog from an extension When loading a dialog from XDL, buttons can have dlg:button-type="cancel" or dlg:button-type="help". These buttons might not have a peer when they are not referenced from the extension. In this case, they also weren't disposed when the dialog was disposed, leading to an abort on exit. Change-Id: I799d7535b766984fde47cafbe41ee6e89e476205 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135266 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> (cherry picked from commit 06d05f62c15510bcd08f55ff7749084e35bbc285) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135744 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index 6a12b915b4aa..080847154cb2 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -238,6 +238,12 @@ void UnoWrapper::WindowDestroyed( vcl::Window* pWindow ) css::uno::Reference< css::lang::XComponent > xComp = pClient->GetComponentInterface( false ); xComp->dispose(); } + else + { + // We need it to dispose the child windows properly (even without window peer), + // otherwise the vcl::Window will be leaked. + pClient.disposeAndClear(); + } pChild = pNextChild; }