[Libreoffice-commits] core.git: sc/inc sc/qa

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 3 19:51:36 UTC 2020


 sc/inc/global.hxx        |    2 +-
 sc/qa/unit/datacache.cxx |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit ece77815300de02ba8fcd9ef6d135c72f3fd9e34
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Aug 3 15:46:37 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Aug 3 21:51:00 2020 +0200

    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 at collabora.co.uk>

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()


More information about the Libreoffice-commits mailing list