diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-06-23 14:26:08 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-06-23 18:54:35 +0900 |
commit | b9019d2920e44842926c3fe77c14c14f0af71c90 (patch) | |
tree | 36ebda52f7089f9f3fcb8f6a486a8f236bf1ed6b /svx/source/core | |
parent | 9ede5cd987a0e9287575875c53f0a10f6412236f (diff) |
Avoid possible memory leaks in case of exceptions
Change-Id: I0cea121c8a8dbbc7b9f44ab712ff692243889816
Diffstat (limited to 'svx/source/core')
-rw-r--r-- | svx/source/core/extedit.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/svx/source/core/extedit.cxx b/svx/source/core/extedit.cxx index 24e93f9d42aa..12864cc04181 100644 --- a/svx/source/core/extedit.cxx +++ b/svx/source/core/extedit.cxx @@ -24,6 +24,7 @@ #include <unotools/ucbstreamhelper.hxx> #include <comphelper/processfactory.hxx> #include <boost/bind.hpp> +#include <boost/scoped_ptr.hpp> #include <com/sun/star/system/SystemShellExecute.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> @@ -45,15 +46,13 @@ void ExternalToolEdit::HandleCloseEvent(ExternalToolEdit* pData) Graphic newGraphic; //import the temp file image stream into the newGraphic - SvStream* pStream = utl::UcbStreamHelper::CreateStream(pData->m_aFileName, STREAM_READ); + boost::scoped_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(pData->m_aFileName, STREAM_READ)); if(pStream) { GraphicConverter::Import(*pStream, newGraphic); // Now update the Graphic in the shell by re-reading from the newGraphic pData->Update( newGraphic ); - - delete(pStream); } } |