diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-06-02 15:51:47 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-06-24 13:42:26 +0200 |
commit | 837c389643cf1735cbb6e05eabbea41d4bd35903 (patch) | |
tree | 1a375dac160cdf44679ecd88598648f8433d8f88 /toolkit | |
parent | 8a7f9a07395e229a54e11ac8cb4f617a90de2669 (diff) |
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 <caolanm@redhat.com>
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
(cherry picked from commit 4879f99b824036b3d409ed52f74dc3eb3b4949e4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135745
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/helper/unowrapper.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index 5d5ce94a9b8f..79d2ee1e2eed 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -240,6 +240,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; } |