summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-01-26 10:12:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-01-30 16:30:16 +0000
commitf0d20b1a7c5369bb205d43f85d4658febbaac006 (patch)
treec1150639a7cda0e9944e0e7ae8f865ab5a33a000
parentcb77f5a5d061bdc460f2606b861f436675443073 (diff)
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/+/146161 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--cui/source/dialogs/SpellDialog.cxx6
-rw-r--r--cui/source/inc/SpellDialog.hxx2
2 files changed, 6 insertions, 2 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 9f110c6a5aa1..1c847e8ed97c 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -160,6 +160,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 )
@@ -218,11 +219,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
@@ -392,6 +395,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;