CID#1038283 Resource leak

Change-Id: I7f8433a76079dc76d888fd250b3033d772887e4d
This commit is contained in:
Caolán McNamara 2013-09-10 18:51:44 +01:00
parent ae8cbeeba0
commit 7a0ac3d38f
2 changed files with 11 additions and 8 deletions

View File

@ -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;
}
};

View File

@ -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();