diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-03 09:04:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-03 12:44:06 +0200 |
commit | dd6f377b3814b70eb37c8c5b31d9f563188adb1d (patch) | |
tree | 61746d8cd2dc8bcefd1aafa4680b2fcfe77803b7 /xmloff/source/style | |
parent | 1de27900d2e1743825f297609f62cb0de3f1a032 (diff) |
avoid ref-counting cycle
this doesn't fix the leak, just reduces the number of cycles involved
here
Change-Id: I31eda167864dc8b5cea2448f598e01f3a807481a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99988
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/style')
-rw-r--r-- | xmloff/source/style/xmlstyle.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index b87939436db1..46c0a43db57d 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -209,7 +209,8 @@ class SvXMLStyleIndex_Impl { OUString sName; XmlStyleFamily nFamily; - const rtl::Reference<SvXMLStyleContext> mxStyle; + // we deliberately don't use a reference here, to avoid creating a ref-count-cycle + SvXMLStyleContext* mpStyle; public: @@ -222,13 +223,13 @@ public: SvXMLStyleIndex_Impl( const rtl::Reference<SvXMLStyleContext> &rStl ) : sName( rStl->GetName() ), nFamily( rStl->GetFamily() ), - mxStyle ( rStl ) + mpStyle ( rStl.get() ) { } const OUString& GetName() const { return sName; } XmlStyleFamily GetFamily() const { return nFamily; } - const SvXMLStyleContext *GetStyle() const { return mxStyle.get(); } + const SvXMLStyleContext *GetStyle() const { return mpStyle; } }; struct SvXMLStyleIndexCmp_Impl |