• Michael Stahl's avatar
    chart2: fix memory leak due to cyclic reference in VAxisBase · 908d1b6e
    Michael Stahl yazdı
    The VAxisBase::m_xNumberFormatsSupplier refers to the ChartModel itself,
    and apparently that is a cyclic reference.  Naively using the
    ChartModel's m_xNumberFormatsSupplier in
    ChartView::impl_createDiagramAndContent() because it will later be passed
    to AxisHelper::getExplicitNumberFormatKeyForAxis(), which expects to be
    able to convert it to a ChartModel.
    
    Since passing around the ChartModel as an XNumberFormattingSupplier is
    sort of un-intuitive anyway, refactor some methods to use XChartDocument
    instead, and only create the VPolarAxis / VCartesianAxis with the
    ChartModel's m_xNumberFormatsSupplier.
    
    The drawback is that if ChartModel::attachNumberFormatsSupplier()
    is called after ChartView::update() has created the axes, it may not
    have an effect on them; not sure if that is a real or hypothetical
    problem.
    
    Change-Id: Ib5f0d5882b85adaf44f80e086f19178b3e64882f
    908d1b6e
ExplicitCategoriesProvider.cxx 21.5 KB