diff options
author | Jian Fang Zhang <zhangjf@apache.org> | 2012-09-03 05:40:25 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-02 11:33:48 +0100 |
commit | 334086d0bdd0ff8a8fc07632c97f02917db6047f (patch) | |
tree | da46e51586d2c57f9dd07e4a6693de5ea506385e /embeddedobj/source/msole | |
parent | db426786a7690943143659adbf38a3768e2c17fe (diff) |
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
Diffstat (limited to 'embeddedobj/source/msole')
-rw-r--r-- | embeddedobj/source/msole/olecomponent.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx index cb5967d2f77f..74b801beb415 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 |