[Libreoffice-commits] core.git: xmloff/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 3 10:44:41 UTC 2020


 xmloff/source/style/xmlstyle.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit dd6f377b3814b70eb37c8c5b31d9f563188adb1d
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Aug 3 09:04:34 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Aug 3 12:44:06 2020 +0200

    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 at collabora.co.uk>

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


More information about the Libreoffice-commits mailing list