cui/source/dialogs/SpellDialog.cxx | 6 +++++- cui/source/inc/SpellDialog.hxx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-)
New commits: commit e3f3229433c7b6bde77ea01ed3ab62b07f04609b Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jan 26 10:12:15 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Jan 30 08:31:51 2023 +0000 fix online crash in SpellDialog program/libmergedlo.so EditEngine::GetUndoManager() /opt/rh/devtoolset-10/root/usr/include/c++/10/bits/unique_ptr.h:173 program/libcuilo.so svx::SpellDialog::InitHdl(void*) cui/source/dialogs/SpellDialog.cxx:2016 program/libmergedlo.so ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) include/rtl/ref.hxx:128 program/libmergedlo.so SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) vcl/headless/svpinst.cxx:317 Change-Id: Icd79faea8b066e0725c5d96f5d9b64445578f3a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146091 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit f6de8eac453b11d5fcfd823ac926521a5e398f9d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146201 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 21f7f2b4da80..e233dffff354 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -161,6 +161,7 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow, : SfxModelessDialogController (_pBindings, pChildWindow, pParent, "cui/ui/spellingdialog.ui", "SpellingDialog") , aDialogUndoLink(LINK (this, SpellDialog, DialogUndoHdl)) + , m_pInitHdlEvent(nullptr) , bFocusLocked(true) , rParent(*pChildWindow) , pImpl( new SpellDialog_Impl ) @@ -219,11 +220,13 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow, //InitHdl wants to use virtual methods, so it //can't be called during the ctor, so init //it on next event cycle post-ctor - Application::PostUserEvent(LINK(this, SpellDialog, InitHdl)); + m_pInitHdlEvent = Application::PostUserEvent(LINK(this, SpellDialog, InitHdl)); } SpellDialog::~SpellDialog() { + if (m_pInitHdlEvent) + Application::RemoveUserEvent(m_pInitHdlEvent); if (pImpl) { // save possibly modified user-dictionaries @@ -387,6 +390,7 @@ void SpellDialog::SpellContinue_Impl(std::unique_ptr<UndoChangeGroupGuard>* pGua */ IMPL_LINK_NOARG( SpellDialog, InitHdl, void*, void) { + m_pInitHdlEvent = nullptr; m_xDialog->freeze(); //show or hide AutoCorrect depending on the modules abilities m_xAutoCorrPB->set_visible(rParent.HasAutoCorrection()); diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 69f491fc6586..da5fee960c84 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -130,7 +130,7 @@ private: OUString m_sTitleSpellingGrammar; Link<SpellUndoAction_Impl&,void> aDialogUndoLink; - + ImplSVEvent * m_pInitHdlEvent; bool bFocusLocked; svx::SpellDialogChildWindow& rParent;