summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-10-01 09:50:36 +0000
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2016-10-01 12:28:38 +0000
commit32c29f79cb976f8b04eb635857ef3b8eecde443e (patch)
treed8da84dd76bb627400f31c13cb9d7c08602de41a /svl
parenta77223b281d79db60c6905e77538f077200b1af8 (diff)
Revert "don't write item right before destruction"
triggers warnings in the dtor if RefCount isn't reset. revert till we have better ref counts and don't need debug code in dtor. This reverts commit b74d2433c856d6d172d9588f4b6d59c31ec02853. Change-Id: I1835885d94e15339aa7602037d850e1524fd9662 Reviewed-on: https://gerrit.libreoffice.org/29427 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/itempool.cxx13
-rw-r--r--svl/source/items/poolio.cxx1
2 files changed, 10 insertions, 4 deletions
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index fbf1281169b7..a2fd333b0470 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -334,12 +334,9 @@ void SfxItemPool::ReleaseDefaults
for ( sal_uInt16 n = 0; n < nCount; ++n )
{
assert(IsStaticDefaultItem(pDefaults[n]));
-
+ pDefaults[n]->SetRefCount(0);
if ( bDelete )
{ delete pDefaults[n] ; pDefaults[n]= nullptr; }
- else
- pDefaults[n]->SetRefCount(0);
-
}
if ( bDelete )
@@ -520,6 +517,9 @@ void SfxItemPool::Delete()
auto& rItemPtr = pImpl->maPoolDefaults[n];
if (rItemPtr)
{
+#ifdef DBG_UTIL
+ SetRefCount(*rItemPtr, 0);
+#endif
delete rItemPtr;
rItemPtr = nullptr;
}
@@ -549,6 +549,9 @@ void SfxItemPool::Delete()
{
if (rItemPtr)
{
+#ifdef DBG_UTIL
+ SetRefCount(*rItemPtr, 0);
+#endif
delete rItemPtr;
rItemPtr = nullptr;
}
@@ -568,6 +571,7 @@ void SfxItemPool::SetPoolDefaultItem(const SfxPoolItem &rItem)
pNewDefault->SetKind(SfxItemKind::PoolDefault);
if (rOldDefault)
{
+ rOldDefault->SetRefCount(0);
DELETEZ(rOldDefault);
}
rOldDefault = pNewDefault;
@@ -592,6 +596,7 @@ void SfxItemPool::ResetPoolDefaultItem( sal_uInt16 nWhichId )
pImpl->maPoolDefaults[GetIndex_Impl(nWhichId)];
if (rOldDefault)
{
+ rOldDefault->SetRefCount(0);
DELETEZ(rOldDefault);
}
}
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 30056e376b5f..42a68764caed 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -470,6 +470,7 @@ void SfxItemPool_Impl::readTheItems (
{
// Reuse
SfxItemPool::AddRef( *pOldItem, rpNewItem->GetRefCount() );
+ SfxItemPool::SetRefCount( *rpNewItem, 0 );
delete rpNewItem;
rpNewItem = pOldItem;
bFound = true;