Bugzilla – Attachment 150095 Details for
Bug 122544
Crash when tunneled dialog is open and document is closed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch attempt
tdf#122544.diff (text/plain), 3.72 KB, created by
How can I remove my account?
on 2019-03-19 10:15:16 UTC
(
hide
)
Description:
Patch attempt
Filename:
MIME Type:
Creator:
How can I remove my account?
Created:
2019-03-19 10:15:16 UTC
Size:
3.72 KB
patch
obsolete
>diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx >index f24e67f9f248..a7df1ed6f33d 100644 >--- a/include/svl/itemset.hxx >+++ b/include/svl/itemset.hxx >@@ -27,11 +27,10 @@ > #include <type_traits> > > #include <svl/svldllapi.h> >+#include <svl/itempool.hxx> > #include <svl/poolitem.hxx> > #include <svl/typedwhich.hxx> > >-class SfxItemPool; >-class SfxPoolItem; > class SvStream; > > typedef SfxPoolItem const** SfxItemArray; >@@ -78,7 +77,7 @@ template<sal_uInt16... WIDs> struct Items {}; > > } > >-class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxItemSet >+class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxItemSet : public SfxItemPoolUser > { > friend class SfxItemIter; > >@@ -231,6 +230,8 @@ public: > bool Equals(const SfxItemSet &, bool bComparePool) const; > > void dumpAsXml(struct _xmlTextWriter* pWriter) const; >+ >+ void ObjectInDestruction(const SfxItemPool& rSfxItemPool) override; > }; > > inline void SfxItemSet::SetParent( const SfxItemSet* pNew ) >diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx >index f520b26a7371..d3e0b4e8aebf 100644 >--- a/svl/source/items/itemset.cxx >+++ b/svl/source/items/itemset.cxx >@@ -92,6 +92,7 @@ SfxItemSet::SfxItemSet(SfxItemPool& rPool) > , m_pParent(nullptr) > , m_nCount(0) > { >+ m_pPool->AddSfxItemPoolUser(*this); > m_pWhichRanges = const_cast<sal_uInt16*>(m_pPool->GetFrozenIdRanges()); > assert( m_pWhichRanges && "don't create ItemSets with full range before FreezeIdRanges()" ); > if (!m_pWhichRanges) >@@ -130,6 +131,7 @@ SfxItemSet::SfxItemSet( > // SfxItemSet::create > m_nCount(0) > { >+ m_pPool->AddSfxItemPoolUser(*this); > assert(wids.size() != 0); > assert(wids.size() % 2 == 0); > std::copy(wids.begin(), wids.end(), m_pWhichRanges); >@@ -142,6 +144,7 @@ SfxItemSet::SfxItemSet( > m_pWhichRanges(new sal_uInt16[2 * wids.size() + 1]), //TODO: overflow > m_nCount(0) > { >+ m_pPool->AddSfxItemPoolUser(*this); > assert(wids.size() != 0); > std::size_t i = 0; > std::size_t size = 0; >@@ -171,6 +174,7 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, const sal_uInt16* pWhichPairTable ) > , m_pWhichRanges(nullptr) > , m_nCount(0) > { >+ m_pPool->AddSfxItemPoolUser(*this); > // pWhichPairTable == 0 is for the SfxAllEnumItemSet > if ( pWhichPairTable ) > InitRanges_Impl(pWhichPairTable); >@@ -181,6 +185,7 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ) > , m_pParent( rASet.m_pParent ) > , m_nCount( rASet.m_nCount ) > { >+ m_pPool->AddSfxItemPoolUser(*this); > // Calculate the attribute count > sal_uInt16 nCnt = 0; > sal_uInt16* pPtr = rASet.m_pWhichRanges; >@@ -234,7 +239,7 @@ SfxItemSet::~SfxItemSet() > if ( 1 < (*ppFnd)->GetRefCount() && !IsDefaultItem(*ppFnd) ) > (*ppFnd)->ReleaseRef(); > else >- if ( !IsDefaultItem(*ppFnd) ) >+ if ( !IsDefaultItem(*ppFnd) && m_pPool ) > // Delete from Pool > m_pPool->Remove( **ppFnd ); > } >@@ -242,9 +247,11 @@ SfxItemSet::~SfxItemSet() > } > > delete[] m_pItems; >- if (m_pWhichRanges != m_pPool->GetFrozenIdRanges()) >+ if (m_pPool && m_pWhichRanges != m_pPool->GetFrozenIdRanges()) > delete[] m_pWhichRanges; > m_pWhichRanges = nullptr; // for invariant-testing >+ if (m_pPool) >+ m_pPool->RemoveSfxItemPoolUser(*this); > } > > /** >@@ -1474,6 +1481,11 @@ void SfxItemSet::dumpAsXml(xmlTextWriterPtr pWriter) const > xmlTextWriterEndElement(pWriter); > } > >+void SfxItemSet::ObjectInDestruction(const SfxItemPool& rSfxItemPool) >+{ >+ if (m_pPool == &rSfxItemPool) >+ m_pPool = nullptr; >+} > > // ----------------------------------------------- class SfxAllItemSet >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 122544
:
148112
| 150095 |
150137