[Libreoffice-commits] core.git: 2 commits - sw/source
Caolán McNamara
caolanm at redhat.com
Wed Oct 2 12:24:19 PDT 2013
sw/source/ui/shells/textfld.cxx | 8 ++++----
sw/source/ui/utlui/glbltree.cxx | 1 +
2 files changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 983419f97d55550b89d42d388c3081c39a58928d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 2 20:22:58 2013 +0100
CID#705764 fix memory leak
Change-Id: Iade3e4cedddb2428d2df8243525d14121722c776
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index e822984..c2666c8 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -496,7 +496,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
sal_Bool bIsUrl=sal_False;
sal_Bool bNew=sal_False;
bool bUpdate = false;
- SwFldMgr* pMgr = new SwFldMgr;
+ SwFldMgr aMgr;
if ( pItem )
{
aText = ((SfxStringItem*)pItem)->GetValue();
@@ -507,7 +507,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
if ( pIsUrl )
bIsUrl = pIsUrl->GetValue();
- SwScriptField* pFld = (SwScriptField*)pMgr->GetCurFld();
+ SwScriptField* pFld = (SwScriptField*)aMgr.GetCurFld();
bNew = !pFld || !(pFld->GetTyp()->Which() == RES_SCRIPTFLD);
bUpdate = pFld && ( bIsUrl != pFld->GetFormat() || pFld->GetPar2() != aType || pFld->GetPar1() != aText );
}
@@ -535,12 +535,12 @@ void SwTextShell::ExecField(SfxRequest &rReq)
if( bNew )
{
SwInsertFld_Data aData(TYP_SCRIPTFLD, 0, aType, aText, bIsUrl);
- pMgr->InsertFld(aData);
+ aMgr.InsertFld(aData);
rReq.Done();
}
else if( bUpdate )
{
- pMgr->UpdateCurFld( bIsUrl, aType, aText );
+ aMgr.UpdateCurFld( bIsUrl, aType, aText );
rSh.SetUndoNoResetModified();
rReq.Done();
}
commit 9f5e82598fc3d145b83d5c6df0f7b5668408608e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 2 20:19:04 2013 +0100
CID#705767 memory leak
Change-Id: I73aa4dd524f9d0d9afbf254fc095da93400b2a54
diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx
index e433b95..438e862 100644
--- a/sw/source/ui/utlui/glbltree.cxx
+++ b/sw/source/ui/utlui/glbltree.cxx
@@ -851,6 +851,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
pSelEntry = PrevSelected(pSelEntry);
if(pSelEntry)
{
+ delete pTempContents;
pTempContents = new SwGlblDocContents;
pActiveShell->GetGlobalDocContent(*pTempContents);
}
More information about the Libreoffice-commits
mailing list