From 35947e357c8a4d2a98f970c5f78f00b27a8ff7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 10 Feb 2020 14:14:12 +0000 Subject: [PATCH] on main window getting focus gtk is destroying the popup windows itself MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit so copy the data we need before it can do that Change-Id: If35d7ba0f272475e82f969bd80c6ff44131a3d2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88376 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/source/tbxctrls/tbcontrl.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 5a72ebf3982a..8096ac0168f1 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2025,9 +2025,14 @@ IMPL_LINK(ColorWindow, SelectHdl, SvtValueSet*, pColorSet, void) maSelectedLink.Call(aNamedColor); - maColorSelectFunction(maCommand, aNamedColor); + // deliberate take a copy here in case maMenuButton.set_inactive + // triggers a callback that destroys ourself + ColorSelectFunction aColorSelectFunction(maColorSelectFunction); + OUString sCommand(maCommand); maMenuButton.set_inactive(); + + aColorSelectFunction(sCommand, aNamedColor); } IMPL_LINK_NOARG(SvxColorWindow, SelectPaletteHdl, ListBox&, void)