diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-03-11 09:36:15 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-03-12 13:04:45 +0000 |
commit | 0295a1f2ac39a0a457f68eae25d44aca28fcb0f8 (patch) | |
tree | a96bd1f99dbf5937c63929427c7656aa95758961 | |
parent | 07125507097c7b9f277fe79a6d21c76246fd5bd2 (diff) |
fix memory leak in ucalc
Change-Id: I8a2fd72894651e9c2c7d099f87853804ba483443
Reviewed-on: https://gerrit.libreoffice.org/23168
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | sc/qa/unit/ucalc_pivottable.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx index 3ec7bd1d8b24..ef1150587d7e 100644 --- a/sc/qa/unit/ucalc_pivottable.cxx +++ b/sc/qa/unit/ucalc_pivottable.cxx @@ -2027,8 +2027,8 @@ void Test::testPivotTableDocFunc() ScRange aDataRange = insertRangeData(m_pDoc, aPos, aData, SAL_N_ELEMENTS(aData)); CPPUNIT_ASSERT_EQUAL_MESSAGE("failed to insert range data at correct position", aPos, aDataRange.aStart); - ScDPObject* pDPObj = createDPFromRange( - m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false); + std::unique_ptr<ScDPObject> pDPObj(createDPFromRange( + m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false)); CPPUNIT_ASSERT_MESSAGE("Failed to create pivot table object.", pDPObj); @@ -2039,8 +2039,8 @@ void Test::testPivotTableDocFunc() ScDPCollection* pDPs = m_pDoc->GetDPCollection(); CPPUNIT_ASSERT_MESSAGE("Failed to get pivot table collection.", pDPs); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDPs->GetCount()); - pDPObj = &(*pDPs)[0]; - ScRange aOutRange = pDPObj->GetOutRange(); + ScDPObject* pDPObject = &(*pDPs)[0]; + ScRange aOutRange = pDPObject->GetOutRange(); { // Expected output table content. 0 = empty cell const char* aOutputCheck[][2] = { @@ -2060,7 +2060,7 @@ void Test::testPivotTableDocFunc() // Remove this pivot table output. This should also clear the pivot cache // it was referencing. - bSuccess = aFunc.RemovePivotTable(*pDPObj, false, true); + bSuccess = aFunc.RemovePivotTable(*pDPObject, false, true); CPPUNIT_ASSERT_MESSAGE("Failed to remove pivot table output via ScDBDocFunc.", bSuccess); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pDPs->GetCount()); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pDPs->GetSheetCaches().size()); |