[Libreoffice-commits] core.git: embeddedobj/source
Jian Fang Zhang
zhangjf at apache.org
Thu May 2 03:34:13 PDT 2013
embeddedobj/source/msole/olecomponent.cxx | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 334086d0bdd0ff8a8fc07632c97f02917db6047f
Author: Jian Fang Zhang <zhangjf at apache.org>
Date: Mon Sep 3 05:40:25 2012 +0000
Resolves: #i113605# missing :ReleaseStgMedium() call on STGMEDIUM object
which causes obvious memory leaks
Found by: zhangjf
Patch by: zhangjf
(cherry picked from commit e0d9b7a23ca3e7ba181134cd89f3f18233031ef1)
Change-Id: I5f99f8cf02e155e5284df3df89feb49d9a30c2c1
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx
index cb5967d..74b801b 100644
--- a/embeddedobj/source/msole/olecomponent.cxx
+++ b/embeddedobj/source/msole/olecomponent.cxx
@@ -1197,6 +1197,9 @@ awt::Size OleComponent::GetExtent( sal_Int64 nAspect )
OSL_FAIL( "Unexpected size is provided!" );
}
}
+ // i113605, to release storage medium
+ if ( SUCCEEDED( hr ) )
+ ::ReleaseStgMedium(&aMedium);
}
}
@@ -1568,6 +1571,7 @@ uno::Any SAL_CALL OleComponent::getTransferData( const datatransfer::DataFlavor&
if ( SUCCEEDED( hr ) )
{
bSupportedFlavor = m_pNativeImpl->ConvertDataForFlavor( aMedium, aFlavor, aResult );
+ ::ReleaseStgMedium(&aMedium); // i113605, to release storage medium
if ( bSupportedFlavor )
{
// TODO/LATER: bring the optimization back when other aspects are supported
More information about the Libreoffice-commits
mailing list