From 7a0ac3d38f521ffee36d90f24b4574f22745bf4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 10 Sep 2013 18:51:44 +0100 Subject: [PATCH] CID#1038283 Resource leak Change-Id: I7f8433a76079dc76d888fd250b3033d772887e4d --- include/svx/nbdtmg.hxx | 12 ++++++------ svx/source/sidebar/nbdtmg.cxx | 7 +++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/svx/nbdtmg.hxx b/include/svx/nbdtmg.hxx index ecf8d19e7bd7..f52897efb4d1 100644 --- a/include/svx/nbdtmg.hxx +++ b/include/svx/nbdtmg.hxx @@ -338,7 +338,7 @@ class SVX_DLLPUBLIC NumberingTypeMgr: public NBOTypeMgrBase public: NumberingTypeMgr(const NBOType aType); NumberingTypeMgr(const NumberingTypeMgr& aTypeMgr); - virtual ~NumberingTypeMgr() {} + virtual ~NumberingTypeMgr(); virtual void Init(); virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0); virtual sal_Bool RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel=(sal_uInt16)0xFFFF); @@ -347,12 +347,12 @@ class SVX_DLLPUBLIC NumberingTypeMgr: public NBOTypeMgrBase virtual sal_Bool IsCustomized(sal_uInt16 nIndex); static NumberingTypeMgr* GetInstance() { - if ( _instance == 0 ) - { - _instance = new NumberingTypeMgr(eNBOType::NUMBERING); - } + if ( _instance == 0 ) + { + _instance = new NumberingTypeMgr(eNBOType::NUMBERING); + } - return _instance; + return _instance; } }; diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 92f9a7690227..e5a6a2b30ad2 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -1318,7 +1318,6 @@ NumberingTypeMgr* NumberingTypeMgr::_instance = 0; NumberingTypeMgr::NumberingTypeMgr(const NBOType aType): NBOTypeMgrBase(aType), - //pNumSettingsArr( new NumSettingsArr_Impl ), pNumberSettingsArr (new NumberSettingsArr_Impl) { Init(); @@ -1331,12 +1330,16 @@ NumberingTypeMgr::NumberingTypeMgr(const NBOType aType): NumberingTypeMgr::NumberingTypeMgr(const NumberingTypeMgr& aTypeMgr): NBOTypeMgrBase(aTypeMgr), - //pNumSettingsArr( new NumSettingsArr_Impl ), pNumberSettingsArr (new NumberSettingsArr_Impl) { ImplLoad(OUString("standard.syb")); } +NumberingTypeMgr::~NumberingTypeMgr() +{ + delete pNumberSettingsArr; +} + void NumberingTypeMgr::Init() { Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();