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
This commit is contained in:
Jian Fang Zhang
2012-09-03 05:40:25 +00:00
committed by Caolán McNamara
parent db426786a7
commit 334086d0bd

View File

@@ -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