summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-03 15:46:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-03 21:51:00 +0200
commitece77815300de02ba8fcd9ef6d135c72f3fd9e34 (patch)
tree1c58dfbeed150c8b45d9d6d35f5a471a127b18c5 /sc
parent7c403473712d847bc2127cc01af3aed24c75f55d (diff)
fix leak in ScCacheTest
and put the init/destruct in constructor/destructor instead of setup(), we want this to run once, not for every test method. Change-Id: I7d5fcdd2974677f1509048c16fb40d03dff289c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100004 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/global.hxx2
-rw-r--r--sc/qa/unit/datacache.cxx3
2 files changed, 3 insertions, 2 deletions
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index b374c8c3f881..3f7ce5d622ee 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -591,7 +591,7 @@ public:
SC_DLLPUBLIC static void Init(); // during start up
static void InitAddIns();
- static void Clear(); // at the end of the program
+ SC_DLLPUBLIC static void Clear(); // at the end of the program
static void InitTextHeight(const SfxItemPool* pPool);
static SvxBrushItem* GetEmptyBrushItem() { return pEmptyBrushItem; }
diff --git a/sc/qa/unit/datacache.cxx b/sc/qa/unit/datacache.cxx
index 462408d7c651..6440e9fe9428 100644
--- a/sc/qa/unit/datacache.cxx
+++ b/sc/qa/unit/datacache.cxx
@@ -31,12 +31,13 @@ public:
CPPUNIT_TEST_SUITE_END();
public:
- virtual void setUp() override
+ ScCacheTest()
{
utl::ConfigManager::EnableFuzzing();
ScDLL::Init();
ScGlobal::Init();
}
+ ~ScCacheTest() { ScGlobal::Clear(); }
};
void ScCacheTest::testCacheSimple()