Issue 113605 - embeddedobj: lacking ::ReleaseStgMedium() call on STGMEDIUM object which causes obvious memory leaks
embeddedobj: lacking ::ReleaseStgMedium() call on STGMEDIUM object which caus...
Status: RESOLVED FIXED
Product: General
Classification: Code
Component: code
OOO320m11
All All
: P2 trivial (vote)
: 4.0.0
Assigned To: mikhail.voytenko
issues@framework
:
Depends on:
Blocks: 120975
  Show dependency treegraph
 
Reported: 2010-08-03 08:24 UTC by zhang jianfang
Modified: 2012-09-15 12:54 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments
fix code patch (815 bytes, patch)
2012-08-22 13:30 UTC, zhang jianfang
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description zhang jianfang 2010-08-03 08:24:12 UTC
in both api OleComponent::GetExtent( sal_Int64 nAspect ), and
OleComponent::getTransferData( const datatransfer::DataFlavor& aFlavor ), they
call the COM API pDataObject->GetData( &aFormat, &aMedium ) to read data from
the STGMEDIUM object.  But after that, the paired com API ::ReleaseStgMedium()
on the STGMEDIUM object is missing, so it causes serious memory leak when
opening a document has ole inside.

+   1c7dc ( 1c7dc -     0)      5 allocs	BackTraceABFD
+       5 (     5 -     0)	BackTraceABFD	allocations

	ntdll!RtlpNtMakeTemporaryKey+000074CE
	ntdll!LdrAlternateResourcesEnabled+00002B05
	ntdll!RtlDosSearchPath_Ustr+00000310
	kernel32!LocalAlloc+00000052
	GDI32!EnumMetaFile+00001187
	GDI32!SetEnhMetaFileBits+00000030
	ole32!HENHMETAFILE_UserUnmarshalWorker+0000006B
	ole32!STGMEDIUM_UserUnmarshalWorker+000000D9
	ole32!STGMEDIUM_UserUnmarshal+0000003D
	RPCRT4!NdrUserMarshalUnmarshall+000000F4
	RPCRT4!NdrUserMarshalUnmarshall+00000083
	RPCRT4!NdrCorrelationPass+00000142
	RPCRT4!NdrClientCall2+000001B8
	ole32!IDataObject_RemoteGetData_Proxy+0000001B
	ole32!CDefObject::GetData+000000C1
	emboleobj!OleComponent::getTransferData+000001F7
(z:\lib\embeddedobj\source\msole\olecomponent.cxx, 1537)
	emboleobj!OleEmbeddedObject::getPreferredVisualRepresentation_Impl+00000612
(z:\lib\embeddedobj\source\msole\olevisual.cxx, 678)
	emboleobj!OleEmbeddedObject::getPreferredVisualRepresentation+0000008E
(z:\lib\embeddedobj\source\msole\olevisual.cxx, 579)
	comphelp4MSC!comphelper::EmbeddedObjectContainer::GetGraphicReplacementStream+00000042
	svtmi!svt::EmbeddedObjectRef::GetGraphicReplacementStream+00000044
(z:\lib\svtools\source\misc\embedhlp.cxx, 877)
	svtmi!svt::EmbeddedObjectRef::GetGraphicStream+00000224
(z:\lib\svtools\source\misc\embedhlp.cxx, 688)
	svtmi!svt::EmbeddedObjectRef::GetReplacement+000001D2
(z:\lib\svtools\source\misc\embedhlp.cxx, 467)
	svtmi!svt::EmbeddedObjectRef::GetGraphic+00000037
(z:\lib\svtools\source\misc\embedhlp.cxx, 485)
	svxmi!SdrOle2Obj::GetGraphic+0000002E (z:\impr\svx\source\svdraw\svdoole2.cxx,
1887)
	svxmi!sdr::contact::ViewContactOfSdrOle2Obj::createViewIndependentPrimitive2DSequence+00000040 (z:\impr\svx\source\sdr\contact\viewcontactofsdrole2obj.cxx, 187)
	svxmi!sdr::contact::ViewContact::getViewIndependentPrimitive2DSequence+00000040
(z:\impr\svx\source\sdr\contact\viewcontact.cxx, 301)
	svxmi!SdrObject::RecalcBoundRect+0000005E
(z:\impr\svx\source\svdraw\svdobj.cxx, 930)
	svxmi!SdrObject::GetCurrentBoundRect+0000002A
(z:\impr\svx\source\svdraw\svdobj.cxx, 912)
	svxmi!SdrObjList::RecalcRects+000000F2 (z:\impr\svx\source\svdraw\svdpage.cxx, 348)
	svxmi!SdrObjList::GetAllObjBoundRect+0000001C
(z:\impr\svx\source\svdraw\svdpage.cxx, 704)
	svxmi!SdrPageView::InvalidateAllWin+000000B7
(z:\impr\svx\source\svdraw\svdpagv.cxx, 318)
	svxmi!SdrPageView::Show+00000029 (z:\impr\svx\source\svdraw\svdpagv.cxx, 290)
Comment 1 zhang jianfang 2010-08-03 08:31:51 UTC
Raise Priority to P2
Comment 2 Mathias_Bauer 2010-08-19 17:10:16 UTC
Mikhail, please have a look.
Sven, is that related to the storage stream problem we discussed?
Comment 3 sven.jacobi 2010-08-19 17:24:26 UTC
sj@mba: no, that was another problem...
Comment 4 zhang jianfang 2012-08-22 13:30:33 UTC
Created attachment 79069 [details]
fix code patch

Need release the com object explicitly
Comment 5 zhang jianfang 2012-08-22 13:31:27 UTC
Set target to AOO 3.5 and change to confirmed state.
Comment 6 SVN Robot 2012-09-03 06:40:49 UTC
"zhangjf" committed SVN revision 1380135 into trunk:
#i113605#, lacking ::ReleaseStgMedium() call on STGMEDIUM object which causes...
Comment 7 zhang jianfang 2012-09-03 06:42:11 UTC
Comment on attachment 79069 [details]
fix code patch

remove review tag since long time no response.
Comment 8 zhang jianfang 2012-09-03 06:42:52 UTC
change to fixed state.