To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113662 Issue #|113662 Summary|sc: When open/close a .ods file with several notes ins |ide, it shows obvious memory leak Component|Spreadsheet Version|OOO310m11 Platform|All URL| OS/Version|All Status|UNCONFIRMED Status whiteboard| Keywords| Resolution| Issue type|PATCH Priority|P2 Subcomponent|code Assigned to|nn Reported by|zhangjfibm
------- Additional comments from [email protected] Thu Aug 5 00:28:19 +0000 2010 ------- Repeat Opening-closing the attached sample .ods file for several times, you can find there is obvious memory increase. The cause of the problem is that for each SC notes object, it will create an ScPostIt object. In this calls ScPostIt::ScPostIt()->ScPostIt::CreateCaption()->ScCaptionCreator.GetCaption(), ScCaptionCreator has an SdrCaptionObj object and returns to ScPostIt, then ScPostIlt store it in DrawPage object by calling, pDrawPage->InsertObject( maNoteData.mpCaption ); While in ScpostIt::RemoveCaption(), it calls, pDrawPage->RemoveObject( maNoteData.mpCaption->GetOrdNum() ); to Remove the SdrCaptionObj from the DrawPage. But the SdrCaptionObj is not released, so it leaks finally. And mpViewContact->mxViewIndependentPrimitive2DSequence attr of SdrObject class which is the base class of SdrCaptionObj keeps so many Primitive2D objects, which makes the leak is obvious. The suggested fix code is, void ScPostIt::RemoveCaption() { ... // remove the object from the drawing page, delete if undo is disabled SdrObject* pObj = pDrawPage->RemoveObject( maNoteData.mpCaption->GetOrdNum() ); // // FIX CODE, Need release the SdrCaptionObj objects explicitly if( !(pDrawLayer && pDrawLayer->IsRecording() )) SdrObject::Free(pObj); ... } --------------------------------------------------------------------- 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]
