summaryrefslogtreecommitdiffstats
path: root/forms/source/richtext
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-04-14 21:28:02 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-04-14 21:47:43 +0900
commitfbf5599c071c6f3203f8992aba4560be9b3b5e42 (patch)
treef15465bdebc3b9d424b010ae1afc8960401c875e /forms/source/richtext
parentClean up function declarations (diff)
downloadcore-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.cxx5
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;