To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113751 Issue #|113751 Summary|sd: There are one SharedPageDescriptor and PageObject |object for each page leak 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] Mon Aug 9 14:02:09 +0000 2010 ------- For each page in sd document, there are one SharedPageDescriptor and PageObject object leak, which then cause obviously memory leak. sd::slidesorter::controller::PageObjectFactory::CreatePageObject(SdPage *,shared_ptr<PageDescriptor::model::slidesorter::sd>::boost const&)const [x:\impr\sd\source\ui\slidesorter\controller\slspageobjectfactory.cxx:68] sd::slidesorter::model::PageDescriptor::GetPageObject(void) [x:\impr\sd\source\ui\slidesorter\model\slspagedescriptor.cxx:110] sd::slidesorter::view::SlideSorterView::Layout(void) [x:\impr\sd\source\ui\slidesorter\view\slidesorterview.cxx:402] sd::slidesorter::controller::SlideSorterController::SetDocumentSlides(Reference<XIndexAccess::container::star::sun::com>::uno::star::sun::com const&) [x:\impr\sd\source\ui\slidesorter\controller\slidesortercontroller.cxx:1049] sd::slidesorter::model::SlideSorterModel::UpdatePageList(void) [x:\impr\sd\source\ui\slidesorter\model\slidesortermodel.cxx:478] sd::slidesorter::SlideSorterViewShell::Init(bool) [x:\impr\sd\source\ui\slidesorter\shell\slidesorterviewshell.cxx:220] sd::framework::BasicViewFactory::CreateView(Reference<XResourceId::framework::drawing::star::sun::com>::uno::star::sun::com const&,SfxViewFrame&,Window&,Reference<XPane::framework::drawing::star::sun::com>::uno::star::sun::com const&,FrameView::sd *) [x:\impr\sd\source\ui\framework\factories\basicviewfactory.cxx:385] sd::framework::BasicViewFactory::createResource(Reference<XResourceId::framework::drawing::star::sun::com>::uno::star::sun::com const&) [x:\impr\sd\source\ui\framework\factories\basicviewfactory.cxx:246] sd::framework::ConfigurationControllerResourceManager::ActivateResource(Reference<XResourceId::framework::drawing::star::sun::com>::uno::star::sun::com const&,Reference<XConfiguration::framework::drawing::star::sun::com>::uno::star::sun::com const&) [x:\impr\sd\source\ui\framework\configuration\configurationcontrollerresourcemanager.cxx:165] The root cause of the leak is, . In SlideSorterModel::GetPageDescriptor(), it creates SharedPageDescriptor objects and stored in maPageDescriptors array object. . in SlideSorterModel::Resync()->SlideSorterModel::ClearDescriptorList (void) call, the maPageDescriptors array is reset and reconstructured. After that SlideSorterModel in fact lose the reference to original SharedPageDescriptor objects, and in sequential call to SlideSorterModel::GetPageDescriptor(), it will create new SharedPageDescriptor() again. . When SlideSorterModel::~SlideSorterModel() is called, the original SharedPageDescriptor's refernce count is decreased to 2. These 2 references are from PageDescriptor->PageObject object and PageDescriptor->PageObject->mpViewContact. But SharedPageDescriptor should responsible of releasing the PageDescriptor->PageObject object. It is also a cyclic reference, although they are all not UNO objects. The fix code will, When SlideSorterModel::Resync()->SlideSorterModel::ClearDescriptorList (void) is called, remember the overwritten SharedPageDescriptor objects into new array object maPageDescriptors_bak. When SlideSorterModel::~SlideSorterModel() is called, free PageDescriptor->PageObject object explicitly, so the dead loop is broken and original SharedPageDescriptor object can be freed normally. Create a new API PageDescriptor::FreePageObject (void) for that purpose. --------------------------------------------------------------------- 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]
