summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-12-20 11:21:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-12-23 12:34:22 +0100
commit15be0847190fee716689938e70fcb4ade208d97f (patch)
treef54a1aa30a74e57805e4dfa540ad8c3e5c51e5ca /cui
parentandroid-viewer translated using Weblate (diff)
downloadcore-15be0847190fee716689938e70fcb4ade208d97f.tar.gz
core-15be0847190fee716689938e70fcb4ade208d97f.zip
tdf#156820 Fix crash in custom color picker
which requires (*) keeping ColorPicker alive during the runAsync in ColorPicker::startExecuteModal (*) keeping the PaletteManager alive during the ExecuteAsync in PaletteManager::PopupCOlorPicker Noting that MattK debugged the cause of this. Change-Id: I07efe8e6514f8882b1347c79c6150578c234bb9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161054 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 78ccae0d42d168f845ddbd7cb694d80dfb04f84d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161161 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 97a81fffc1c2ab77749c462b61b3eed860b09d77) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161164
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/colorpicker.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 24dda1936a2a..688a64f190ec 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -1345,12 +1345,13 @@ void SAL_CALL ColorPicker::setDialogTitle( const OUString& )
void SAL_CALL ColorPicker::startExecuteModal( const css::uno::Reference< css::ui::dialogs::XDialogClosedListener >& xListener )
{
std::shared_ptr<ColorPickerDialog> xDlg = std::make_shared<ColorPickerDialog>(Application::GetFrameWeld(mxParent), mnColor, mnMode);
- weld::DialogController::runAsync(xDlg, [this, xDlg, xListener] (sal_Int32 nResult) {
+ rtl::Reference<ColorPicker> xThis(this);
+ weld::DialogController::runAsync(xDlg, [xThis, xDlg, xListener] (sal_Int32 nResult) {
if (nResult)
- mnColor = xDlg->GetColor();
+ xThis->mnColor = xDlg->GetColor();
sal_Int16 nRet = static_cast<sal_Int16>(nResult);
- css::ui::dialogs::DialogClosedEvent aEvent( *this, nRet );
+ css::ui::dialogs::DialogClosedEvent aEvent( *xThis, nRet );
xListener->dialogClosed( aEvent );
});
}