summaryrefslogtreecommitdiff
path: root/sc/qa/unit/parallelism.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-03 14:46:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-04 01:40:11 +0200
commit8c4a24092bd9ccd1d577d10ae0559cef406e8fae (patch)
treee05086166f732db7e02551defa39d2d4dddd8795 /sc/qa/unit/parallelism.cxx
parent5c7e838714f5d071c4882115cef9c843fb603287 (diff)
fix some DocShell leaks in unit tests
need to call DoClose() to unwind the internal ref-counting Change-Id: Ibfd13e2300f3542e5e86363facd5b41dbfafdf6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100001 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/qa/unit/parallelism.cxx')
-rw-r--r--sc/qa/unit/parallelism.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/sc/qa/unit/parallelism.cxx b/sc/qa/unit/parallelism.cxx
index 2b5b0ba73cc5..39a133648a00 100644
--- a/sc/qa/unit/parallelism.cxx
+++ b/sc/qa/unit/parallelism.cxx
@@ -30,8 +30,6 @@ public:
virtual void setUp() override;
virtual void tearDown() override;
- void getNewDocShell(ScDocShellRef& rDocShellRef);
-
void testSUMIFS();
void testDivision();
void testVLOOKUP();
@@ -148,7 +146,10 @@ void ScParallelismTest::setUp()
ScDLL::Init();
- getNewDocShell(m_xDocShell);
+ m_xDocShell = new ScDocShell(
+ SfxModelFlags::EMBEDDED_OBJECT |
+ SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
+ SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
m_pDoc = &m_xDocShell->GetDocument();
sc::FormulaGroupInterpreter::disableOpenCL_UnitTestsOnly();
@@ -164,17 +165,11 @@ void ScParallelismTest::tearDown()
if (!m_bThreadingFlagCfg)
setThreadingFlag(false);
+ m_xDocShell->DoClose();
+ m_xDocShell.clear();
test::BootstrapFixture::tearDown();
}
-void ScParallelismTest::getNewDocShell( ScDocShellRef& rDocShellRef )
-{
- rDocShellRef = new ScDocShell(
- SfxModelFlags::EMBEDDED_OBJECT |
- SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
- SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
-}
-
void ScParallelismTest::testSUMIFS()
{
m_pDoc->InsertTab(0, "1");