summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-05-23 12:57:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-26 09:53:14 +0200
commit661eed7b8e5412a0c6f952dc30a529683a2f5986 (patch)
treef5a0097bea5123952918b9317bad58a25c8d4240
parenta7fbc89b67189455afaf5681f33db07daf06c28f (diff)
related tdf#158914 sc a11y: Release references when disposing sheet
Clear all `ScAccessibleCell` references that are owned by `ScAccessibleSpreadsheet` when disposing the sheet instead of when the sheet is deleted. While `ScAccessibleSpreadsheet::disposing` is always called, `ScAccessibleSpreadsheet::~ScAccessibleSpreadsheet` is not called until all of the sheet's `ScAccessibleCell` instances have been deleted. So make sure that `ScAccessibleSpreadsheet::disposing` releases all `ScAccessibleCell` references. This might possibly reduce some of the leaks mentioned in [1]. [1] https://gerrit.libreoffice.org/c/core/+/167961/comments/15a6a4e4_91a77291 Change-Id: Iaf14338945c1899d54c8e7f8a16f38a48316ac98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167985 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 4d2c41e8171139e210d94b0c3c2b6b3d6392665a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168051 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 7aaa7237ccac..020386a69af8 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -310,7 +310,11 @@ void SAL_CALL ScAccessibleSpreadsheet::disposing()
mpViewShell->RemoveAccessibilityObject(*this);
mpViewShell = nullptr;
}
+
mpAccCell.clear();
+ m_mapSelectionSend.clear();
+ m_mapFormulaSelectionSend.clear();
+ m_pAccFormulaCell.clear();
ScAccessibleTableBase::disposing();
}