summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-10-26 12:53:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-27 08:53:15 +0200
commitf5457c856fbfbf3fa9dd23bee84e32dd1227eae0 (patch)
treea20bc8d4fafacf6ada7ee5649553b8179cd06226 /sw
parent9be47276cdd6a59647f6aa42d2cd35f05c51a16b (diff)
Revert "use rtl::Reference in SwChartDataSequence"
This reverts commit cdd4b528a4d200aa322891373c80e2bc8e6cd16c. The manual acquire()/release() is necessary to prevent a double-delete if the exception is thrown Change-Id: I5acc0840befba3981e13b084b8d347f8a2766e70 Reviewed-on: https://gerrit.libreoffice.org/43889 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unochart.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 79439553fb34..1d06634c6950 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -1860,7 +1860,7 @@ SwChartDataSequence::SwChartDataSequence(
{
m_bDisposed = false;
- rtl::Reference<SwChartDataSequence> aSelfHold(this);
+ acquire();
try
{
const SwTable* pTable = SwTable::FindTable( &rTableFormat );
@@ -1876,11 +1876,13 @@ SwChartDataSequence::SwChartDataSequence(
}
catch (uno::RuntimeException &)
{
+ // TODO: shouldn't there be a call to release() here?
throw;
}
catch (uno::Exception &)
{
}
+ release();
#if OSL_DEBUG_LEVEL > 0
// check if it can properly convert into a SwUnoTableCursor
@@ -1904,7 +1906,7 @@ SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) :
{
m_bDisposed = false;
- rtl::Reference<SwChartDataSequence> aSelfHold(this);
+ acquire();
try
{
const SwTable* pTable = SwTable::FindTable( GetFrameFormat() );
@@ -1920,11 +1922,13 @@ SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) :
}
catch (uno::RuntimeException &)
{
+ // TODO: shouldn't there be a call to release() here?
throw;
}
catch (uno::Exception &)
{
}
+ release();
#if OSL_DEBUG_LEVEL > 0
// check if it can properly convert into a SwUnoTableCursor