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
(cherry picked from commit d47b674951aedd03815a3f27591b1791f7dfb52d)
diff --git a/sw/source/uibase/app/swdll.cxx b/sw/source/uibase/app/swdll.cxx
index cb6d19e..1e598ef 100644
--- a/sw/source/uibase/app/swdll.cxx
+++ b/sw/source/uibase/app/swdll.cxx
@@ -41,7 +41,9 @@
#include <svx/fmobjfac.hxx>
#include <svx/svdfield.hxx>
#include <svx/objfac3d.hxx>
#include <editeng/acorrcfg.hxx>
#include <swacorr.hxx>
#include <unomid.h>
#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 e3817b1..ce4339a 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -60,7 +60,6 @@
#include <docsh.hxx>
#include <swmodule.hxx>
#include <swevent.hxx>
#include <swacorr.hxx>
#include <cmdid.h>
#include <dobjfac.hxx>
#include <init.hxx>
@@ -118,7 +117,6 @@
#include <svx/rubydialog.hxx>
#include <svtools/colorcfg.hxx>
#include <editeng/acorrcfg.hxx>
#include <unotools/moduleoptions.hxx>
#include <avmedia/mediaplayer.hxx>
@@ -192,11 +190,6 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
pAuthorNames = new std::vector<OUString>; // 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()