From d47b674951aedd03815a3f27591b1791f7dfb52d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 21 Nov 2014 22:38:02 +0100 Subject: fdo#86494: sw: fix crash on exit from SwAutoCorrect 5bff4b016c4b44f4123e0e6a4fd4c0c4dc0cfa2d was not enough to fix it, so move it to SwDLL so it gets deleted earlier, before the global pool items. (regression from 4404b718bdb547cb9b7b17c73a53574724cdeeb7) Change-Id: I4f88047852ea71f07ffa1f272ea66743f9797327 --- sw/source/uibase/app/swdll.cxx | 11 +++++++++++ sw/source/uibase/app/swmodule.cxx | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/sw/source/uibase/app/swdll.cxx b/sw/source/uibase/app/swdll.cxx index cb6d19e079e1..1e598ef029b4 100644 --- a/sw/source/uibase/app/swdll.cxx +++ b/sw/source/uibase/app/swdll.cxx @@ -41,7 +41,9 @@ #include #include #include +#include +#include #include #include "swdllimpl.hxx" @@ -135,10 +137,19 @@ SwDLL::SwDLL() // register your controllers here RegisterControls(); #endif + + // replace SvxAutocorrect with SwAutocorrect + SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); + const SvxAutoCorrect* pOld = rACfg.GetAutoCorrect(); + rACfg.SetAutoCorrect(new SwAutoCorrect( *pOld )); } SwDLL::~SwDLL() { + // fdo#86494 SwAutoCorrect must be deleted before _FinitCore + SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); + rACfg.SetAutoCorrect(0); // delete SwAutoCorrect before exit handlers + // Pool has to be deleted before statics are SW_MOD()->RemoveAttrPool(); diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index e3817b1061b5..ce4339af8458 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include @@ -118,7 +117,6 @@ #include #include -#include #include #include @@ -192,11 +190,6 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, pAuthorNames = new std::vector; // All Redlining-Authors - // replace SvxAutocorrect with SwAutocorrect - SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); - const SvxAutoCorrect* pOld = rACfg.GetAutoCorrect(); - rACfg.SetAutoCorrect(new SwAutoCorrect( *pOld )); - StartListening( *SfxGetpApp() ); // OD 14.02.2003 #107424# - init color configuration @@ -227,9 +220,6 @@ SwModule::~SwModule() { delete pErrorHdl; EndListening( *SfxGetpApp() ); - - SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); - rACfg.SetAutoCorrect(0); // delete SwAutCorrect before exit handlers } void SwModule::CreateLngSvcEvtListener() -- cgit v1.2.3