diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-05-19 22:25:31 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-05-19 22:28:31 +0900 |
commit | 018e2f629e125f1a0fe33471a0e4fe606813aa91 (patch) | |
tree | 68e8420ba62a0cb41b32edc766943d9c9249715d /sd/source/ui/animations | |
parent | b1aa528721c578767985a1b31f653375f26db076 (diff) |
Avoid possible memory leaks in case of exceptions
Change-Id: I61fe5f5fff157531de9962a2dd4e6e0431e8601c
Diffstat (limited to 'sd/source/ui/animations')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 457e2de93c5c..8ccd1176f812 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -82,6 +82,7 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/range/b2drange.hxx> +#include <boost/scoped_ptr.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::animations; @@ -1562,15 +1563,13 @@ void CustomAnimationPane::showOptions(const OString& sPage) { STLPropertySet* pSet = createSelectionSet(); - CustomAnimationDialog* pDlg = new CustomAnimationDialog(this, pSet, sPage); + boost::scoped_ptr<CustomAnimationDialog> pDlg(new CustomAnimationDialog(this, pSet, sPage)); if( pDlg->Execute() ) { addUndo(); changeSelection( pDlg->getResultSet(), pSet ); updateControls(); } - - delete pDlg; } void CustomAnimationPane::onChangeCurrentPage() @@ -1743,7 +1742,7 @@ void CustomAnimationPane::onChange( bool bCreate ) } } - CustomAnimationCreateDialog* pDlg = new CustomAnimationCreateDialog( this, this, aTargets, bHasText, sPresetId, fDuration ); + boost::scoped_ptr<CustomAnimationCreateDialog> pDlg(new CustomAnimationCreateDialog( this, this, aTargets, bHasText, sPresetId, fDuration )); if( pDlg->Execute() ) { addUndo(); @@ -1812,7 +1811,7 @@ void CustomAnimationPane::onChange( bool bCreate ) mrBase.GetDocShell()->SetModified(); } - delete pDlg; + pDlg.reset(); updateControls(); |