To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113699 Issue #|113699 Summary|sd: Opening a ppt file, there is obvious memory leak b |ecause the SotStorage object for reading ppt files lea |ks Component|Drawing Version|OOO310m11 Platform|All URL| OS/Version|All Status|UNCONFIRMED Status whiteboard| Keywords| Resolution| Issue type|PATCH Priority|P2 Subcomponent|code Assigned to|graphicsneedsconfirm Reported by|zhangjfibm
------- Additional comments from [email protected] Fri Aug 6 06:23:53 +0000 2010 ------- This memory leak problem can be easily recreated by opening any ppt files, then close it. The storage object created at the begin of api sdmi.dll!SdPPTFilter::Import(), which causes obvious memory leak from SD. The root cause is, The callstack fragment when importing a ppt files, > sdmi.dll!PropRead::PropRead(SotStorage & rStorage={...}, const String & rName={...}) Line 597 C++ sdmi.dll!ImplSdPPTImport::Import() Line 296 + 0x7e bytes C++ sdmi.dll!SdPPTImport::Import() Line 185 C++ > sdmi.dll!SdPPTFilter::Import() Line 113 + 0xb bytes C++ sdmi.dll!sd::DrawDocShell::ConvertFrom(SfxMedium & rMedium={...}) Line 517 + 0x36 bytes C++ At the beging of api SdPPTFilter::Import(), an SotStorageRef is created for reading ppt contents, SdPPTFilter::Import() { SotStorageRef pStorage = new SotStorage( mrMedium.GetInStream(), FALSE ); .... SdPPTImport* pImport = new SdPPTImport( &mrDocument, *pDocStream, *pStorage, mrMedium, &aTracer ); ... } In api PropRead::PropRead(), the above Storage object is used to ceate a mpSvStream for reading, at that time mpSvStream keep a reference back to the storage object. PropRead::PropRead() {... mpSvStream = rStorage.OpenSotStream( rName, STREAM_STD_READ ); } The definition of mpSvStream is, class PropRead : private List { sal_Bool mbStatus; SvStorageStream* mpSvStream; ..} Here PropRead class doesn't define an explictly dtor. So there is no explicit code to free PropRead.mpSvStream object, which in sequence cause the pStorage object is not released too. Solution: Suggested solution is very simple, in file propread.hxx change the mpSvStream to, class PropRead : private List { sal_Bool mbStatus; SvStorageStreamRef mpSvStream; ..} --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
