diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-12-18 15:24:58 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-12-19 15:19:27 +0100 |
commit | 66cd725b5f386d48252a620fb58415ddb65388ef (patch) | |
tree | 2906138cff28cedfb3722d2017d85a9bdf0a989a /unotools | |
parent | 816fd52f32f1c8bec0d7d902cb13a26499a27c35 (diff) |
Don't leak SvtSaveOptions instance through ItemHolder1::holdConfigItem
...where ItemHolder1 apparently leaks the items ever since
> commit ef2c49c9a5788e35249d8d5406a09c84ecd062ee
> Author: RĂ¼diger Timm <rt@openoffice.org>
> Date: Fri Nov 11 07:50:10 2005 +0000
>
> INTEGRATION: CWS perform06 (1.6.60); FILE MERGED
> 2005/11/07 13:32:40 as 1.6.60.2: #i56589# dont cache GlobalEventConfig() inside ItemHolder1^... combination of static pointer and WeakImplHelper cant not work
> 2005/10/25 08:04:02 as 1.6.60.1: #i56589# hold config items alive till office die
That started to cause problems when 78a6ce17f06fbe13b806fd563e85a4fe60d3bcfc
"DELETEZ->std::unique_ptr in toolkit,unotools" now stopped to leak the global
static std::unique_ptr<SvtLoadSaveOptions_Impl> pOptions;
in unotools/source/config/saveopt.cxx when any SvtSaveOptions instances are
leaked, so that at least PythonTest_pyuno_pytests_testcollections started to
fail in ASan builds now when that global pOptions is destroyed at exit.
I don't see a good reason for that ItemHolder1::holdConfigItem stuff here, so
lets try and drop it from SvtSaveOptions at least.
Change-Id: I6d44708fc4e2e5dfafaa9bfe8f3fa2f854ae0952
Reviewed-on: https://gerrit.libreoffice.org/46726
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/itemholder1.cxx | 5 | ||||
-rw-r--r-- | unotools/source/config/saveopt.cxx | 3 |
2 files changed, 0 insertions, 8 deletions
diff --git a/unotools/source/config/itemholder1.cxx b/unotools/source/config/itemholder1.cxx index f3dfcc98af5e..91a44af5d715 100644 --- a/unotools/source/config/itemholder1.cxx +++ b/unotools/source/config/itemholder1.cxx @@ -39,7 +39,6 @@ #include <unotools/pathoptions.hxx> #include <unotools/printwarningoptions.hxx> #include <unotools/optionsdlg.hxx> -#include <unotools/saveopt.hxx> #include <unotools/searchopt.hxx> #include <unotools/securityoptions.hxx> #include <unotools/viewoptions.hxx> @@ -177,10 +176,6 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem) rItem.pItem.reset( new ::utl::MiscCfg() ); break; - case EItem::SaveOptions : - rItem.pItem.reset( new SvtSaveOptions() ); - break; - case EItem::SecurityOptions : rItem.pItem.reset( new SvtSecurityOptions() ); break; diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx index 35b721702f21..657eb6563488 100644 --- a/unotools/source/config/saveopt.cxx +++ b/unotools/source/config/saveopt.cxx @@ -32,7 +32,6 @@ #include <osl/diagnose.h> #include <osl/mutex.hxx> #include <comphelper/processfactory.hxx> -#include "itemholder1.hxx" #include <officecfg/Office/Recovery.hxx> using namespace utl; @@ -805,8 +804,6 @@ SvtSaveOptions::SvtSaveOptions() pOptions.reset(new SvtLoadSaveOptions_Impl); pOptions->pSaveOpt.reset(new SvtSaveOptions_Impl); pOptions->pLoadOpt.reset( new SvtLoadOptions_Impl); - - ItemHolder1::holdConfigItem(EItem::SaveOptions); } ++nRefCount; pImp = pOptions.get(); |