diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-04-14 21:28:02 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-04-14 21:47:43 +0900 |
commit | fbf5599c071c6f3203f8992aba4560be9b3b5e42 (patch) | |
tree | f15465bdebc3b9d424b010ae1afc8960401c875e /forms/source/richtext | |
parent | Clean up function declarations (diff) | |
download | core-fbf5599c071c6f3203f8992aba4560be9b3b5e42.tar.gz core-fbf5599c071c6f3203f8992aba4560be9b3b5e42.zip |
Avoid possible memory leaks in case of exceptions
Change-Id: Id71cb49d8aa241a17efd4cbe217a48f2d7c34e84
Diffstat (limited to 'forms/source/richtext')
-rw-r--r-- | forms/source/richtext/richtextengine.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/forms/source/richtext/richtextengine.cxx b/forms/source/richtext/richtextengine.cxx index 4712a61fbf13..1a1cb0cb6250 100644 --- a/forms/source/richtext/richtextengine.cxx +++ b/forms/source/richtext/richtextengine.cxx @@ -35,7 +35,7 @@ #include <algorithm> #include <functional> - +#include <boost/scoped_ptr.hpp> namespace frm { @@ -85,14 +85,13 @@ namespace frm RichTextEngine* pClone( NULL ); { SolarMutexGuard aGuard; - EditTextObject* pMyText = CreateTextObject(); + boost::scoped_ptr<EditTextObject> pMyText(CreateTextObject()); OSL_ENSURE( pMyText, "RichTextEngine::Clone: CreateTextObject returned nonsense!" ); pClone = Create(); if ( pMyText ) pClone->SetText( *pMyText ); - delete pMyText; } return pClone; |