summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-05-28 16:18:58 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-06-02 15:37:58 +0200
commit861fbd998f2b526c2aea073c9471613bf728fa75 (patch)
tree21cc4539a5a6b835479c78c451d505c1b03ec2a7 /sc
parent3581f1d71ae0d431ba28c0f3b7b263ff6212ce7b (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>
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 ac89e288bda1..afacfecc4640 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -394,6 +394,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();
}