summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-05-28 16:18:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-03 11:37:43 +0200
commitb0556da3a0966c9c68c6a57909524058d0bb5e07 (patch)
treedf65661c4e8fee6fdff1632b95dd033fb17d6f2f /sc
parent35ec66f8766bd3d8f17c9e0ea68d1e260a9fbc32 (diff)
purge shared string pool if ScDocument is closed (tdf#125428)
Especially with the testcases given in the bugreport the undo history would keep many unused shared strings. Change-Id: I57fcad73532fdcbad0a1298fbd06cb35c058bf96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95045 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> (cherry picked from commit 861fbd998f2b526c2aea073c9471613bf728fa75) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95323 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen2.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index cc45c83c30d4..3cbe6374d676 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -390,6 +390,9 @@ ScDocument::~ScDocument()
SAL_WARN_IF( pAutoNameCache, "sc.core", "AutoNameCache still set in dtor" );
mpFormulaGroupCxt.reset();
+ // Purge unused items if the string pool will be still used (e.g. by undo history).
+ if(mpCellStringPool.use_count() > 1)
+ mpCellStringPool->purge();
mpCellStringPool.reset();
}