diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-06-30 11:33:26 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-06-30 11:44:16 +0900 |
commit | b20e6acea2cb2013f450bb4b97b51142dbb4f161 (patch) | |
tree | e441dfb4fdca68c9c0cd2f76cbf955d93b0a74d8 /svx/source/svdraw/svdtext.cxx | |
parent | d4feafb064560f27fce8ed3e760325545e7ba539 (diff) |
Avoid possible memory leaks in case of exceptions
Change-Id: I9a92edd7886db484f1333585545f6f63a233a6dd
Diffstat (limited to 'svx/source/svdraw/svdtext.cxx')
-rw-r--r-- | svx/source/svdraw/svdtext.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx index 33729927360f..0dc5081a0165 100644 --- a/svx/source/svdraw/svdtext.cxx +++ b/svx/source/svdraw/svdtext.cxx @@ -25,6 +25,7 @@ #include "editeng/fhgtitem.hxx" #include <editeng/eeitem.hxx> #include <svl/itemset.hxx> +#include <boost/scoped_ptr.hpp> SdrText::SdrText( SdrTextObj& rObject, OutlinerParaObject* pOutlinerParaObject /* = 0 */ ) : mpOutlinerParaObject( pOutlinerParaObject ) @@ -172,7 +173,7 @@ void SdrText::ForceOutlinerParaObject( sal_uInt16 nOutlMode ) { if( mpModel && !mpOutlinerParaObject ) { - Outliner* pOutliner = SdrMakeOutliner( nOutlMode, mpModel ); + boost::scoped_ptr<Outliner> pOutliner(SdrMakeOutliner( nOutlMode, mpModel )); if( pOutliner ) { Outliner& aDrawOutliner = mpModel->GetDrawOutliner(); @@ -181,8 +182,6 @@ void SdrText::ForceOutlinerParaObject( sal_uInt16 nOutlMode ) pOutliner->SetStyleSheet( 0, GetStyleSheet()); OutlinerParaObject* pOutlinerParaObject = pOutliner->CreateParaObject(); SetOutlinerParaObject( pOutlinerParaObject ); - - delete pOutliner; } } } |