Author: zhangjf
Date: Mon Sep 3 06:40:25 2012
New Revision: 1380135
URL: http://svn.apache.org/viewvc?rev=1380135&view=rev
Log:
#i113605#, lacking ::ReleaseStgMedium() call on STGMEDIUM object which causes
obvious memory leaks
Found by: zhangjf
Patch by: zhangjf
Modified:
incubator/ooo/trunk/main/embeddedobj/source/msole/olecomponent.cxx
Modified: incubator/ooo/trunk/main/embeddedobj/source/msole/olecomponent.cxx
URL:
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/embeddedobj/source/msole/olecomponent.cxx?rev=1380135&r1=1380134&r2=1380135&view=diff
==============================================================================
--- incubator/ooo/trunk/main/embeddedobj/source/msole/olecomponent.cxx
(original)
+++ incubator/ooo/trunk/main/embeddedobj/source/msole/olecomponent.cxx Mon Sep
3 06:40:25 2012
@@ -1205,6 +1205,9 @@ awt::Size OleComponent::GetExtent( sal_I
OSL_ENSURE( sal_False,
"Unexpected size is provided!" );
}
}
+ // i113605, to release storge medium
+ if ( SUCCEEDED( hr ) )
+ ::ReleaseStgMedium(&aMedium);
}
}
@@ -1578,6 +1581,7 @@ uno::Any SAL_CALL OleComponent::getTrans
if ( SUCCEEDED( hr ) )
{
bSupportedFlavor = m_pNativeImpl->ConvertDataForFlavor(
aMedium, aFlavor, aResult );
+ ::ReleaseStgMedium(&aMedium); // i113605, to release
storge medium
if ( bSupportedFlavor )
{
// TODO/LATER: bring the optimization back when other
aspects are supported